1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Resolved SimTools memory map interface

Discussion in 'SimTools DIY Version' started by telesimke, Feb 26, 2017.

  1. telesimke

    telesimke New Member Gold Contributor

    Joined:
    Feb 25, 2017
    Messages:
    10
    Location:
    Slovenia
    Balance:
    42Coins
    Ratings:
    +2 / 0 / -0
    Hi!

    I have a problem with memory map not writing sensible data to the memory map. Has anyone got memorymap working?

    My setup:
    upload_2017-2-26_16-24-38.png

    upload_2017-2-26_16-25-26.png

    Output seems OK

    upload_2017-2-26_16-26-38.png

    This is what I recive on the other side from memory map

    upload_2017-2-26_16-28-17.png

    <code>
    mmf = MemoryMappedFile.OpenExisting("simtools_memorymap");

    MemoryMappedViewAccessor accessor = mmf.CreateViewAccessor(0, 128, MemoryMappedFileAccess.Read);

    int fl = accessor.ReadInt32(0);
    int fr = accessor.ReadInt32(4);
    int rl = accessor.ReadInt32(8);
    int rr = accessor.ReadInt32(12);

    Console.WriteLine($"{fl},{fr},{rl},{rr}");

    </code>

    BR upload_2017-2-26_16-24-38.png upload_2017-2-26_16-25-26.png

    Attached Files:

    • Winner Winner x 1
  2. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,282
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,198Coins
    Ratings:
    +5,093 / 18 / -0
    Hi @telesimke,
    For testing purposes, will you please set your Output - Bit Range to 8 bit.
    And please set your axis mixing like this.
    This way we are just sending the output of one dof and It will be easier to see what's happening.
    1.jpg

    Now run the test again and see what you get buddy!
    yobuddy
    • Informative Informative x 1
  3. telesimke

    telesimke New Member Gold Contributor

    Joined:
    Feb 25, 2017
    Messages:
    10
    Location:
    Slovenia
    Balance:
    42Coins
    Ratings:
    +2 / 0 / -0
    Hi youbuddy!

    I did like you asked and also set the Axis limiting to 8, 20 and 50%. The output still does not reflect actual forces
    upload_2017-2-27_16-52-29.png

    I changed the accessor read to "accessor.ReadSByte(0);"

    BR
  4. telesimke

    telesimke New Member Gold Contributor

    Joined:
    Feb 25, 2017
    Messages:
    10
    Location:
    Slovenia
    Balance:
    42Coins
    Ratings:
    +2 / 0 / -0
    Hi i see that you are the author of memorymap interface!
    Could you send me the source code so I can do a debug?
    BR
  5. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,282
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,198Coins
    Ratings:
    +5,093 / 18 / -0
    @telesimke
    Please remove the axis limiting so we get numbers I don't have to do math for.
    The screen shot above does noting to tell me what is happening as I have no idea what your inputs are at the time of the screen shot.

    Please remove the axis limiting, and when you startup Output Testing, you should see all 127 for outputs?
    Please try this and see what you get.

    Also, why not just use decimal as the output type just for testing?
    It just takes one more possible problem out of the equation.
    (binary is the fastest way to send the data thou)
    yobuddy
  6. telesimke

    telesimke New Member Gold Contributor

    Joined:
    Feb 25, 2017
    Messages:
    10
    Location:
    Slovenia
    Balance:
    42Coins
    Ratings:
    +2 / 0 / -0
    Hi!

    Here is the output from 8bit decimal with the car not moving(output is showing slight movement of the axes) and all 12 axes are being read.
    upload_2017-2-27_22-42-20.png

    br
  7. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,282
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,198Coins
    Ratings:
    +5,093 / 18 / -0
    I really don't have enough information as to how you got the output you did above.
    So lets try this with an example, I think it may be easier.

    First Setup an output like this.
    MMF_How2Setup.jpg

    Now you can use my Memory Map Example App to get you started.
    Gui.jpg

    Please set this thread to resolved should this get you going buddy
    Hope this helps!
    yobuddy

    Download the Starter App Here:

    Attached Files:

    • Like Like x 1
    • Informative Informative x 1
  8. telesimke

    telesimke New Member Gold Contributor

    Joined:
    Feb 25, 2017
    Messages:
    10
    Location:
    Slovenia
    Balance:
    42Coins
    Ratings:
    +2 / 0 / -0
    The first axis seems to be corrupted because it will be of value "0\9". All the other axis are fine.
    BR
  9. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,282
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,198Coins
    Ratings:
    +5,093 / 18 / -0
    I did all my testing with Axis1a included.
    I did not see any problems.
    Please show me how to reproduce the error your seeing, or I have no way of even being able to look at the problem you are seeing buddy.
    yobuddy
  10. telesimke

    telesimke New Member Gold Contributor

    Joined:
    Feb 25, 2017
    Messages:
    10
    Location:
    Slovenia
    Balance:
    42Coins
    Ratings:
    +2 / 0 / -0
    Hi!
    It baffled me too because your code was running smoothly and mine kept getting exceptions. Eventually I realised that your code does not try to parse to int.
    But if you try to parse axis1 to int you will get an exception after a few seconds.
    Funny thing is that it only effects Axis1. If I move my four axis one step up it runs smoothly.

    p.s. I would love to implemet binary output using at least 10 bits. I'm out of luck here so please share a few words on that subject

    Thank you for your support so far!
    BR
  11. smallmadtv

    smallmadtv The Astrophotgrapher Gold Contributor

    Joined:
    Dec 23, 2020
    Messages:
    10
    Occupation:
    Tech Manager
    Location:
    Belgium - Sambreville
    Balance:
    100Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Arduino, 4DOF, 6DOF

    Hi I just download Visual Studio and try to compile it.
    But when I run the app, I don't have any number displayed.

    See here:
    upload_2021-1-1_12-47-52.png


    this is my setup:
    upload_2021-1-1_12-48-40.png

    Any idea, where I can find the file? Maybe I need to store the app in a specific folder? like Simtool?

    Thx for any reply!

    FYI, this is just a casual investigation on the different interface type...

    Attached Files: