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

I need help :)

Discussion in 'New users start here - FAQ' started by Charvel, Sep 8, 2010.

  1. Charvel

    Charvel New Member

    Joined:
    Sep 7, 2010
    Messages:
    8
    Occupation:
    Student
    Location:
    Turkey
    Balance:
    2Coins
    Ratings:
    +0 / 0 / -0
    Hello people!

    I decided to build a simulator with microcontroller.But i have some questions.If you help me out i'll be very glad.

    1.I'll communicate with rs323 (via USB adapter) and i'll use USO.Is the USO seds data itself or i need an interface plugin?
    2.If i had solved comminication problem then i'll be need to know binary codes for gear etc. How can i calculate them?

    Thats all what i need to know but i'll be add more questions later :) THANK YOU SO MUCH ! :)
  2. dhweizel

    dhweizel New Member

    Joined:
    Mar 16, 2010
    Messages:
    27
    Location:
    Buenos Aires, Argentina
    Balance:
    339Coins
    Ratings:
    +0 / 0 / -0
    Hi,
    USO send data itself but you must instruct the uso to define witch values must send using some codes like ~a01~ that is the code to send the value of the axis 1.
    Yo can set the format of the serial output to be a byte , a 16 bit word etc. and define if the output must be binary or text based (numbers or hexa) and the frequency to be sent.

    Is something similar to a C printf or a c# format function

    Do you want to make a motion platform or a gauge panel?


    Regards,
  3. Charvel

    Charvel New Member

    Joined:
    Sep 7, 2010
    Messages:
    8
    Occupation:
    Student
    Location:
    Turkey
    Balance:
    2Coins
    Ratings:
    +0 / 0 / -0
    Thank you very much dhweizel!

    I'm going to build a gauge panel.Maybe later i can add a motion platform but i need to learn how the x-sim works.

    I need to learn C++ i think. I know assembly and basic.

    First i'll make a Gear indicator with 7 seg. Led display. I'm understand that:

    I'll add an axis.
    Then go to math setup.Add a output and select sender input 60 (Gear)
    In Output Setup, I select USO and select a comport and add to the list.
    Then i select 8bit and binary output
    I'll use USO so i need to fill the ''Datapacket with axis informations'' If i write only ~a01~ then USO will sent data as something like 11110101 am i right?
  4. dhweizel

    dhweizel New Member

    Joined:
    Mar 16, 2010
    Messages:
    27
    Location:
    Buenos Aires, Argentina
    Balance:
    339Coins
    Ratings:
    +0 / 0 / -0
    I don't have the x-sim software here but i think that the procedure is ok

    The x-sim software scales automatically the output value to the defined size so in your example the output will be a single byte, as example the scaled value 120 will shows as a character x in a terminal(ASCII table) and not the characters 1111000 , if you need a human readable output you can choose the hex format that shows as printed hex numbers.

    I don't have any experience whit the gauge system but i think that there is some dedicated interfaces o modules somewhere in the x-sim software. May be the wiki can help you more.

    Regards,
  5. Charvel

    Charvel New Member

    Joined:
    Sep 7, 2010
    Messages:
    8
    Occupation:
    Student
    Location:
    Turkey
    Balance:
    2Coins
    Ratings:
    +0 / 0 / -0
    In ascii table 120 shows as a character ''x'' and shows as a binary ''01111000''.
    If i choose binary format from output setup, it sends as x or 01111000 ??

    Sorry but im a slow learner. And thanks again. You're helping a lot. By the way. I like your simulator. It works perfect :)
  6. dhweizel

    dhweizel New Member

    Joined:
    Mar 16, 2010
    Messages:
    27
    Location:
    Buenos Aires, Argentina
    Balance:
    339Coins
    Ratings:
    +0 / 0 / -0
    The value 120 at 8 bits sends as x

    Thanks for the compliment
  7. Charvel

    Charvel New Member

    Joined:
    Sep 7, 2010
    Messages:
    8
    Occupation:
    Student
    Location:
    Turkey
    Balance:
    2Coins
    Ratings:
    +0 / 0 / -0
    So there isn't any way to send it as binary format?
  8. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    You are transmitting everything in binary format. The microcontroller receives everything in binary too.

    Decimal checkbox will transmit each digit separately in a byte, instead of converting a value straight into binary.

    128 in binary is 10000000.
    128 in decimal, transmitted as binary: 00000001, 00000010, 00001000

    The ASCII code is just a character assigned to an 8bit binary value. x = 120 and so on...
    It is the exact same thing to transmit 'x' or to transmit 120 in binary.

    Programming the controller with a C compiler:
    if(byte == 'x') will give you the same result as if(byte == 120)
  9. Charvel

    Charvel New Member

    Joined:
    Sep 7, 2010
    Messages:
    8
    Occupation:
    Student
    Location:
    Turkey
    Balance:
    2Coins
    Ratings:
    +0 / 0 / -0
    Ok i get it now! Thank you Frakk!