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

Question Problems about writing a plugin

Discussion in 'SimTools Plugins' started by ZKILLA, May 31, 2017.

  1. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    @ZKILLA
    Please try this one.
    yobuddy

    Attached Files:

    • Like Like x 1
    • Friendly Friendly x 1
  2. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Curious what method you used to parse the packet @yobuddy? How I do it is send a unique identifying character before each value sent out in a packet and then do this for example.

    start = InStr(packet, "r") ______________'Find start position of "r" in the packet
    temp = Mid(packet, start + 2, 6)________ 'Parse out numeric characters for roll @16bit
    roll = Val(temp)______________________'Convert numeric characters into a real number

    start = InStr(packet, "p")
    temp = Mid(packet, start + 2, 6)
    pitch = Val(temp)

    This can be repeated for as many dof's as you wish to output.
    Last edited: Jun 7, 2017
  3. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Nice work man, this app works perfectly!!! Both positive and negative value can be shown correctly! Thank you buddy! And what's our next step?

    Attached Files:

    • Like Like x 1
    • Winner Winner x 1
  4. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    Ok, cool!
    So now we know how to correctly collect data from the "game".

    Ill just explain that I usually do this "build a test app" approach to getting a new plugin to work.
    It proves I am collecting the data correctly, and now I don't have to worry about that part anymore when building the plugin.

    Anyway, the next step is to get the process name for the "game" you want the plugin to trigger on.
    Use ctrl-alt-del to bring up the task manager and look at the process name for LabVIEW.
    I'll need that to trigger SimTools into action.

    The last optional thing to deal with is weather or not we want to make the plugin automatically patch LabVIEW with whatever you did to get it to spit out these packets.
    (this is useful when sharing plugins, but not needed for us to get it working.)

    Would be cool if we could make this a generic LabVIEW plugin that could work for anyone's models. Basically all we would have to do is update it to send all 6 DOF's (instead of just the 2) and people could use what they need. But I have not used LabVIEW, so I'm not even sure how you are getting packets and if that's possible lol.

    Here is the source code to look over for what we just did.
    You will see its super simple and even multithreaded.

    Chat soon,
    yobuddy

    Attached Files:

    • Informative Informative x 1
    • Friendly Friendly x 1
  5. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    @BlazinH and all others too,
    There is really a ton of approaches here, and I can even argue with myself over how it should be done.
    You see the less steps you take to get the info, the faster it will be.
    But the better you parse out the data, the more exact or safer it will be.
    So its give and take half dozen the other. lol :D

    But this is also a good reason for the Test app, as I can go back at any time and try out different ways to pars the data.
    And then simply update my game plugin as needed.
    More so, what I'm trying to do here, is to show a way to approach building a game plugin.
    Take Care guys (and maybe one girl if we are lucky)!
    yobuddy
    • Informative Informative x 1
  6. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Thanks for your explanation bro, I'll check the process name and tell you tomorrow noon, coz I'm doing this project in lab so I can't check it right now. Cheers!
  7. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Okay, fair enough. Imo though the data must be exact and safe. Thanks for replying. ;)
    Last edited: Jun 8, 2017
  8. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Hi buddy, I think this is the process name that you need, the first one is the process name of labview and the following two are the name of my UPD blocks, one is front panel and the other is block diagram. Cheers buddy.
    WechatIMG11.jpeg
  9. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    What is the LabVIEW exe name buddy?
    "LabView.exe"?
  10. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Yes, I think so if I remember correctly.
  11. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Labview.png
  12. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Hi buddy, I'm not sure that if upper or lower case letter will matter your work so I made a screenshot, the name is LabVIEW.exe, Cheers buddy, waiting for your good news.
  13. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    :thumbs, ill put the plugin together for you tomorrow buddy, as I have the day off.
    • Friendly Friendly x 1
  14. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Alright, thank you buddy!
  15. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    Here is test #1.
    You will have to use the Tuning Center to tune in Roll and Pitch.
    Remember to "Patch the game" via the Game manger.
    Let me know how it goes. @ZKILLA :thumbs
    yobuddy

    Attached Files:

  16. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Hey buddy, I found some problems really important...How can I use this plugin? I checked every where in GameManager and find no place to update the plugin. Is it because that I'm demo-mode user? I really feel so sad:(
  17. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
  18. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Do you think my project can be accepted? Because it's a psychology machine, not a racing game device. By the way, because I'm transporting the UDP packets remotely, which means Labview is installed on A computer but the Simtools is on the B computer, how can I patch the "game"? Thank you for your answer, buddy.
  19. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    It can be patched because the plugin knows it needs no path for the plugin to work.
    So by 'patching' you are simply activating the plugin.
    Are you actually building a Simulator buddy?
    Got a link to your project man?
  20. ZKILLA

    ZKILLA Member

    Joined:
    Apr 5, 2017
    Messages:
    54
    Location:
    Australia
    Balance:
    417Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    SCN5, SCN6
    Alright, I'm going to update my project today and see if it can be used to apply a free license. It's actually a simulator, basically it is a CDP (computerized dynamic posturography) system, and a subject standing on a force platform which can record subject's motion and the platform can supply stimuli to the subject by tilting. I just use two SCN6 motors to achieve the tilt motion, and try to use Labview to control the movement of the whole platform. The test result can be used to analysis patient's balance system impairment, that's why I said it's a psychology machine. Anyway, I'll post it today and share you a link, cheers buddy.