Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Custom Bits

Hi,
I'm an undergraduate currently doing my thesis for FYP using LabView. I would like to seek help on how to generate custom bits in LabView 8.0. Let's say i want to generate 8bits of the value 255 which is 11111111 as an output to RS232. Which instrument on the LabView should i use to do this. If somenone has an example of similar function program, could you please kindly post it here.
Thank you. 
0 Kudos
Message 1 of 5
(3,917 Views)

you normally use the VISA write.vi to send data to the rs232. If you give more details of what do you want to do, I (or someone else) might give a more detailed answer. For example the rs232 protocol will send more bits than your declaired data bits (Start/stop/parity). Digg into the KB basic notes about RS232 to learn more 😉

 

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 ǝɥʇ'


Message 2 of 5
(3,915 Views)
thank you very much for your reply.
Actually what i wanted to do is to send a command of three bytes to be pass down to a peripheral device through the RS232.
The command is used to control the position of servo motors. The first byte is a sync marker with a fixed value of 255. The second byte indicates the servo no. (0-254) and the third byte to indicate the position (0-254).
These must be sent as individual byte values. Basically i need to build an interface where i can input the servo no. and a button or dial which i can change the value of the 3rd byte which changes the servo position.
 
What i need help is to how to generate the values of these three bytes. Regrading the VISA serial, i think i could figured it out myself because i have a few example of that. 
Thanks again.
0 Kudos
Message 3 of 5
(3,910 Views)

At a first try you can send your three bytes as one string.

With the byte array to string vi you can build your send string.

For the first try use the example vi (simple serial write read)  and right click on the send string control and set it to '\-code' or HEX display mode to enter your values.

 

Message Edited by Henrik Volkers on 07-20-2006 03:37 PM

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 ǝɥʇ'


Message 4 of 5
(3,904 Views)
thank you henrik. the information you gave is very helpful indeed.
0 Kudos
Message 5 of 5
(3,898 Views)