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 What does SimTools output to controller over serial port?

Discussion in 'SimTools Pro & Entertainment Version' started by Edward B Gilbert, Nov 30, 2018.

  1. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    I want to program a PLC to take inputs from SimTools and run a servo motors actuator that I am building. I have been doing a lot of digging but am not able to determine what the packet sent to the controller by SimTools consists of.
    I am looking for information that will explain what is sent over the parallel cable and how it should be parsed by the controller. For example is it an array with the axis, position, and velocity, or is it a string of characters that need to be parsed int commands and positions?
    The standard documentation does not do a very good job of explaining this unless I have missed something.
    Thanks in advance for your feedback. The more information on this the better.
  2. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    With a custom interface Simtools can output just about anything you require. But the standard interface outputs a string which consists of identifiers of your choosing followed by axis positions.
  3. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    Ok, So it appears that I have been over thinking this. How about motor speed?
  4. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Motor speed is a function of the motor controller based on its PID settings and the difference between the setpoint and the current position (error).
    Last edited: Nov 30, 2018
  5. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    I get that part, but does SimTools output motor speed based on a function, for example, slamming on the breaks would seem to throw you forward faster than letting off the accelerator, or am I over thinking this on also?
  6. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    Does the PLC need to return any information back to SimTools?
  7. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Over thinking. Simtools simply outputs what the game physics is outputting but scales it to work with whatever setup you have. But if you don't exactly like the unfiltered feeling directly from the game you can use filters like washout to make it return more slowly.
    • Like Like x 1
  8. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    No.
  9. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    If I go with the standard interface alone what would that look like? For example is it AxisAPOSITION. In other words, how would the string be constructed to identify the axis and position if I don't use any customer identifiers? An example string would be helpful.
  10. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Appendix B: User Formatted Output
    Output can be achieved to just about any serial device with some basic outputformatting. Output
    formatting allows you to send both the axis information along with
    any additional information you need to send to your interface.
    Take this interface for example; it requires a "Hello" to be sent at the beginning of every
    message to the interface. An "End" stringis also required to be sent at the end of every
    message. If we were using Axis1 for our output, it would look like this.
    Hello<Axis1a>End
    If the value of Axis1 is "1123" and Decimal Type output is selected, the output would
    look like this "Hello1123End". The "1123" simply gets substituted for "<Axis1a>" when
    the string is sent to the interface.

    https://simtools.us/wp-content/uploads/2018/09/SimToolsUserManual-v1.2.pdf
    • Like Like x 1
  11. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Btw, if you don't use identifiers then its would be easiest to use an output type that always sends the same length string. Then you will already know which axis position is where in the string and identifiers aren't needed.
    • Agree Agree x 1
  12. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    I saw this part, so in this example is "Hello" the axis name and "1123" the position?
  13. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,307
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,488Coins
    Ratings:
    +5,109 / 18 / -0
    In this example the Interface requires a string "Hello" to be sent at the beginning of every message.
    And the string "End" to be at the end.
    The Axis position value should be in-between these two strings.

    So you would use for the output: Hello<Axis1a>End
    Where the output would actually look like "Hello1123End" as the <Axis1a> gets replaced with the value of the axis when the message is sent.

    Take care,
    yobuddy
  14. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    I guess I still don't understand how this works. How does this break down? Hello<Axis1a>End What part of the string is is the motor number and part of the string is the position? When I am setting up the motors in SimTools do I replace Hello with the motor I am controlling and then use that to identify the motor on the PLS program. For example AxisOne<Axis1a> AxisTwo<Axis2a> AxisThree<axis3a>. Then on the PLC use AxisOne, AxisTwo, AxisThree as the identifier for the motor using a switch statement. Case: AxisOne: do something; Case: AxisTwo: do something; Case AxisThree: do something;
    Is this the right way to handle this?
  15. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,307
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,488Coins
    Ratings:
    +5,109 / 18 / -0
    Sure, that will work.
    It's really up to how you want to do it.

    Another way could be to output binary (char output) and it will have a fixed number of digits per motor.
    So in 8 bit the output of this:<Axis1a><Axis2a><Axis3a>
    Would look something like this "2af".

    Maybe build a little UPD receiver, so you can use the .net output type in SimTools to output the data and catch and take a look at what you have received.
    The .net output type and serial output type work the same way.
    Take care,
    yobuddy
    • Agree Agree x 1
  16. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    I am left still confused as to what is being sent to the controller over the com port. If you are controlling three motors how is it packaged and sent over the serial port? Is it an array with each index a position of one of the tree motors, is it a string of numbers that need to be parsed? What exactly is being sent to the controller? What does it look like when it gets there, how does it need to be taken apart to be useful information? This has been the question all along. There is no information at all about who SimTools packages the data before it is sent to the controller. If I don't have a clear understanding of what is coming over the serial port I won't be able to parse it. So, if possible can you be very specific as to what SimTools does when there are three axes when it sends the position for them over the com port. Here is an example of what I am looking for as an answer: "Yes, It is an array and each index is the position for the motor, so <Axis1a><Axis2a><Axis3a> looks like this when it is received string[3] so parsing it you would set Axis one equal to string[0], Two to string[1], and three to string[2]". Or "SimTools sends a long string that is ApositionBpositonCposition where position is the numeric value for the positions."
    If I can get a clear answer like this I will know exactly how to parse the incoming serial data. The more information the better.
  17. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Sorry for the confusion but as a stated programmer I thought this would be enough information for you to know what we mean. Its just like yobuddy stated above, if you use <Axis1a><Axis2a><Axis3a> with 8 bit binary output in Simtools for the output string you will receive something like “2af” in a single string where 2 is Axis1a position, a is Axis2a position, and f is Axis3a position. Parse each character and use the asc() function to convert them into 8 bit numbers. Its as simple as that.
    Last edited: Dec 2, 2018
  18. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    Ok, now I get it. Thank you for the clarification. This thread has been extremely helpful.
  19. Edward B Gilbert

    Edward B Gilbert Inventor, programmer, and CNC machinist Gold Contributor

    Joined:
    Nov 22, 2018
    Messages:
    11
    Occupation:
    CNC Operator, Inventor, programmer, and nerd!
    Location:
    USA
    Balance:
    237Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    6DOF
    I know this was briefly discussed earlier but I wanted to make sure I understand that no speed information for the axis that is output by SimTools? If not speed would be a great feature to add in the future for a more realistic experience. Here is an example. If you lightly apply the break you will not feel the deceleration the same way as if you slam on the breaks. The only way to truly give that effect would be to throw the platform forward faster by increasing the speed of the actuator.
    If there is a way to incorporate seed please advise.
  20. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    You can get speed and other dash type data from Simtools Game Dash. You have to set up another port for it to work on though. But for what you want during breaking it's already in the surge dof, you don't need speed.
    • Agree Agree x 3