LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question: Bit control in RS232 / User Interface

Greetings all,
 
As you can read in the title I have two questions and since I'm a first time poster, I chose the LabVIEW forum to place them (due to the nature of the questions, this seemed the best choice). I apologize if I did something wrong by doing so.
 
I tried my best to search for an anwser on the forum, but I couldn't find an anwser to either questions. It's possible I missed it and then a helpfull link would be appreciated.
 
Some general background: I'm working on a school project and I'm using LabVIEW as the control program. For that I'm making a user interface. LabVIEW will communicate with the rest of the system using the RS232 protocol
 
Question 1: Is it possible to control (as in setting or clearing) the individual bits in the data part of an RS232 message? This would greatly help in coming up with a workable protocol between LabVIEW and the rest of the project.
 
Question 2: For the user interface I was thinking of working with several buttons who would give access to different submenu's (as in a menu to add new parts and a menu to "program" the different parts). The current shape of the interface is like a reactangle and the buttons are located on the left side. Is it possible to have different submenu's in the remainig void (and not next to each other, but each submenu can use the entire remaining void; off course this means that only one submenu can be active at the time)?
 
If you have questions or remarks: please give them! I will try my best to anwser them.
 
Thank you for your time.
0 Kudos
Message 1 of 8
(3,297 Views)
For question 1: The RS232 protocol is just a serial protocol meaning it just sends out whatever characters you specify. Each character is 8 bits (can be 7) so you just specify the character that corresponds to the bit pattern you want. In that respect you "control" the bits. I assume whatever you're talking to is not a message-based device (as in sending "VOLT 3" to set the voltage to 3 V), but rather some sort of code-based device (as in "A8 03" where A8 is the command to set the voltage and 03 is the voltage value)? If not, why would you want to do it this way? What is "the rest of the system"?

For question 2: I'm trying to wrap my head around what you're asking, but I'm confused, and I believe it's because of terminology. I think you're talking about tabs and/or subpanels, but I'm not sure. If that's the case, then both of these are available with LabVIEW. You should take a look at the user interface examples that ship with LabVIEW.
0 Kudos
Message 2 of 8
(3,285 Views)
Concerning your question 1: I'm not sure what you mean by controlling the individual bits, but you can control the data that is being transfered over the serial interface. However, RS232 IO is asynchronous, character-oriented data. In its most common form each character sent will have 1 start bit, 7 or 8 data bits (depending on the coding being used) and 1 stop bit. You can define the characters that are being sent. In addition, a serial interface has several hardware handshake lines with names like RTS or CTS. LV can also control these. The manual on the device that you are controlling should tell you what to send to communicate with the device.

Concerning question 2: LV has a very complete set of tools for creating a user interface. For the kind of user interface you are describing I would look into subpanels as a way of putting controls into the "void" area of your front panel.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(3,283 Views)


@smercurio_fc wrote:
I assume whatever you're talking to is not a message-based device (as in sending "VOLT 3" to set the voltage to 3 V), but rather some sort of code-based device (as in "A8 03" where A8 is the command to set the voltage and 03 is the voltage value)?


Yes, the device is code based. Hence my first desire to want to have direct control over setting/clearing individual bits.


@mikeporter wrote:
Concerning your question 1: You can define the characters that are being sent. In addition, a serial interface has several hardware handshake lines with names like RTS or CTS. LV can also control these. The manual on the device that you are controlling should tell you what to send to communicate with the device.


So if I want to send "00000001" [which is the SOH in Ascii] I would be able to do that? So far I have only succeeded in entering keyboard characters (like numbers and letters and reading signs), any tips to get those other codes as well (for SOH, DEL, NUL, ...)?

The device is "homemade" and has no manual to speak off, but the handshake signals are connected, because LabVIEW (or windows) espects them to be present, despite them not being used.

 


@smercurio_fc wrote:
What is "the rest of the system"?


A box with a microprocessor who decodes the LabVIEW signals and who send wireless signals to several clocks.

 


@smercurio_fc wrote:
For question 2: I'm trying to wrap my head around what you're asking, but I'm confused, and I believe it's because of terminology. I think you're talking about tabs and/or subpanels, but I'm not sure. If that's the case, then both of these are available with LabVIEW. You should take a look at the user interface examples that ship with LabVIEW.


If they are in LabVIEW 7.1, then I'll have no problem finding them.

0 Kudos
Message 4 of 8
(3,248 Views)

You can send anything you want with the VISA Write function. You have several options:

1: If you have a string control/constant, you can right click on it and select Hex Display.

2. If you want to use a numeric control/constant, you can use either the Type Cast or the Byte Array to String function.

Message Edited by Dennis Knutson on 07-26-2007 03:16 PM

0 Kudos
Message 5 of 8
(3,246 Views)

HI

Even i have the same question . can v control the bits of rs232 . i mean can v ourself set or reset the bits of different pins of 9 pin rs232.

regards 

AVINASH 

AVINASH
0 Kudos
Message 6 of 8
(3,199 Views)

For the same question, I would give the same answer. See above...

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(3,179 Views)
By opening a VISA session to the serial port initialize vi, and creating a property node, you can control/read any of the pins on the 9 pin connector.  I forget which pins are what, but they are called CTS, RTS, DTR, DSR, CD. etc...  See attached picture:
 
This code is not complete, just an example of what can be done.  You should wire in values for the states and you should wire in values on the serial init vi.  Right clicking on a state will give you the option to bring up a help screen.

Message Edited by tbob on 07-31-2007 09:02 AM

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 8
(3,171 Views)