From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-15-2018 10:39 AM
Hi,
I am looking to create a vi that is able to read ASCII commands from the instrument and write commands. I have looked at different examples and i think i have an idea on how to go about creating the communication. But i am trying to create sequence structure because there will be different commands the operator will be inputting. The problem is some of the commands that are being put in are a little long, there is a checksum included but i believe that the checksum is actually being done, by the module so i don't think ill need to create a checksum vi. ill have a snippet of some of the commands, hopefully that'll give you some idea of what I am looking at. i just want to bounce ideas off and maybe get some idea of the best way to go about creating different commands that work in the same vi.
10-15-2018 11:30 AM
1. I like to make libraries and/or classes for my instruments. In these, you can have a different VI for each command/query.
2. You will probably need to make a checksum VI. You did not include any information on the messages you will send, but at the very least you will want it to verify you got a proper message.
3. No need for a Sequence Structure here. Proper error handling will create the data flow you need to sequence your code.
10-15-2018 12:10 PM
I believe that is what I will have to do. Sorry i should've attached it, its attached now. can you elaborate on what "proper error handling" would look like? Regarding the Vi's why do you think ill need a checksum vi? the device that i am sending these commands to already has a checksum calculation in it.
10-15-2018 12:17 PM
You have to calculate the checksum and put it in your message. That is how the instrument knows it got a valid message. It is clearly there in the protocol.
10-17-2018 09:08 AM
So I have the checksum calculation working correctly, but im running into a problem. What i am trying to do is let the user pick between different commands and based on those commands the system is able to adjust to it. For example, i would the user to be able to click on the position control mode, that would then input the % that would allow them to regulate where the position *i have attached the vi* i would like some pointers on how to do that. Also if you have any advice on my current setup i would be more then willing to correct it !
10-17-2018 09:29 AM
1. No need for ANY of those local variables. Use wires. This will also remove the need for the sequence structure.
2. Again, make a VI for each command you want to send.
3. Use an Event Structure. This way you only have to send the commands when something actually changes.