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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Outputing Pre-programmed Serial Commands

Good Afternoon,
 
I'm connecting a stepper motor to LabVIEW and was able to make it work with the basic serial write and read example vi very nicely.  I was just curious if there was a way to store  a couple separate sets of code (essentially programs) that could be fed to the serial port on command with LabVIEW depending on the users need.
 
If I was too vague, let me know.
0 Kudos
Message 1 of 5
(2,645 Views)
Do you mean like having different controls on a front panel and based on which control the user operates will result in different commands being sent to the serial port? You are kinda vauge.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 2 of 5
(2,638 Views)
In short yes. Smiley Wink

You can store text in strings and arrays just like other software languages and also pull data from text files or other file formats. These could concievably be stored command sequences for your stepper motor which could then be sent down the serial port under software control.

Check out the help files on strings and then follow it up with arrays, after that look at reading in files. The help files are really excellent, one of the softwares strong points.

Looks like your project is growing all the time, hope all the stuff in the previous question hit the mark.

Message Edité par Conseils le 01-06-2006 11:16 PM

0 Kudos
Message 3 of 5
(2,634 Views)
you got it working in basic (not the language) , so now it's time to think about your dataflow stucture.
 
You want multiple moves (commands) for your stepper ... do you need feedback (at least error checking) ?  
Or a variable time delay between your steps? Or ....
 
I would use a producer- consumer structure   and an queue of cluster that defines one complete move (and error condition handling).
 
 
Just my thoughts
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 5
(2,615 Views)
Yes, that's exactly what I mean.  I would love it if I could have different controls on a front panel and depending on which control the user operates it would result in different pre written commands being sent to the serial port.
 
I'm going to dig into this issue this morning, but I'm fairly new to LabVIEW, and would appreciate and assistance on the matter.  If anyone has an example or something similar, I would love to see it.
 
Thanks!
0 Kudos
Message 5 of 5
(2,603 Views)