LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending in a series of commands

I'm trying to build a user interface where there is an option for users to reset the motor position values of my telescope.  With the motors that i'm using, this can only be accomplished by sending about 5 individual command lines, one by one to the motors before it can work.  (For example, i need to send in command line 1, wait for the motors to respond that they got that, before i can proceed on sending the second command line).  Is there a way that i can do this in labview where the user only needs to hit the "reset' button once and my program will automate through the entire process of sending out all of the necessary commands one at a time?  I was looking through flat sequence structure, but dont' quite understand how that works or if this will be a good choice for what i'm trying to do.  Any suggestions would be appreicated!

Cheers,
Chelle
0 Kudos
Message 1 of 4
(2,450 Views)
How are you communicating with the motor?  Is it serial functions?  Then look at the examples for Basic Serial Read and Write.
 
For multiple commands, you could place each one as an element in a string array.  Feed the Array to a For loop that surrounds the VISA write.  With autoindexing turned on  ( shows up as [ ] at the tunnel) it will pick out each array element one by one.
0 Kudos
Message 2 of 4
(2,448 Views)
It's serial communication and i have been using the basic read write serial command vi already, except i only enter 1 command like at a time.  These are what my command lines that my motors takes looks like:

@16 145\r
@16 154 11 50000\r
@16 165 10\r
@16 165 532\r
@16 165 1802\r


Obviously, the 5 strings are of different sizes.  Mroeover, where exactly is this "string array" that you are referring to?  i guess i have to build it myself but i just looked through the array menu and string menu and i'm not sure which one to use.  Here are th eones that i fuond that i think could be possible: spreadsheet string to array (but i;m not sure where the spreadsheet string is).  Any help?? thanks

0 Kudos
Message 3 of 4
(2,438 Views)
Drop an Array constant on your block diagram.  Drop a String constant on your block diagram.  Right click and set it for \codes.  Drag and drop the string constant into the array constant.  Now you have an empty string array.  Drag the border downwards so you see more elements at once.  Type a string into each element.
0 Kudos
Message 4 of 4
(2,430 Views)