LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help developing simple control

Hi guys,

I was wondering if anybody can help me with my application. Firstly I am communicating with a device that is hooked up via the serial port. At the moment I send a text string and the device drives a motor, however I want to creat buttons and knobs to send the text string. The string I send to the instrument is a mixture between letters and numbers for example ff9 means let both motors run foward at speed 9. Now what I would like to do is have a button that sends the letter part i.e.ff and then a knob to send the number part i.e 9 these must then be merged together before being send to the instrument as ff9, can anybody please assist me with this. Another query I have is that I would like to ultimately make my VI an executea
ble stand alone file, how do I do this.

Thanks alot

"Steve"
0 Kudos
Message 1 of 4
(2,735 Views)
Hi Steve:
The knob will be your numeric control setting speed of the motor. Use Number To Decimal String to convert the number to string.
I assume that you want to use the button to control forward / reverse rotation.You can use a case structure to select desired string (ff etc.)
You can use concatenate strings to concatenate strings from the number to decimal string and and forward / reverse string from the case structure and write concatinated string to serial port when the boolean is pressed.
You want to read help on the case structures, string functions and build text express VI ONLY in LV 7.0 and above).
0 Kudos
Message 2 of 4
(2,733 Views)
If you have LabVIEW 7.1, easiest would be to use a radio button control containing a button for each possible direction (FF, FR, RF, FS, etc. (forward, reverse, stop, etc.). A case structure would provide the correct string for each possibility. Are both motors always running at the same speed or do you need separate speed control for each?
In this case, you could also make two vertical sliders, one for each motor (e.g. going from -9 to 9), then in the code you could synthesize the FF part depending on the signs of each control.

If you go with the buttons, add a knob. Use the output of the knob and convert it to the %d formatted string of desired length.

At the end you simply concatenate all the strings to form the proper command to be sent to the instr
ument.

To make a standalone executable you need either LabVIEW Professional or higher. If you only have base or full, you need to purchase the application builder sperately. Contact your NI sales rep for details.
0 Kudos
Message 3 of 4
(2,733 Views)
Thanks, I will give it a try

Cheers

Steve
0 Kudos
Message 4 of 4
(2,733 Views)