LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 communication with 9 databits

Hi,
 
I want to use LabVIEW to communicate with a uC'er via an USB/RS485 device. The communication protocol is set up to 9 databits (9'th data bit specify address/command).
How can this be solved in LabVIEW ??
VISA serial port configuration only accept 5-8 databits.
Is it possible to 'build' the RS485 commands bit by bit, and easily transmit them (on a COM port) using LabVIEW ??
0 Kudos
Message 1 of 6
(4,860 Views)
seach the knowledgebase , I have in mind that you can use VISA with (some?) NI-Serial cards to establish an 9-databit communication.  
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 6
(4,848 Views)
Modbus uses 8 databits plus a parity bit for a nine bit datastream. Over 15 years ago, I had to make a Modicon P190 programmer talk to a VAX computer over the broadband network. I fought this setup for weeks until I found out that the broadband modems did not support a nine bit datastream. A different version of the modems did support nine bit data streams. It should not be a problem from the computer side of things. Implementing the correct protocol inside labview will be the tricky part.

Message Edited by unclebump on 01-23-2006 04:15 AM

0 Kudos
Message 3 of 6
(4,845 Views)
As Henrik said, search the NI KnowledgeBase: How Can I Do 9-bit Serial Transmission Instead of 7 or 8 bits?
Message 4 of 6
(4,828 Views)
About a year and a half ago I had to do this on a project. My recollection of the protocol I had to create was that the ninth bit was only used to signal when the address was being sent. I did this by playing games with the parity settings. Timing was very critical (the unit that was addressed would respond really quickly) and while it would work on a built in serial port it wouldn't on the USB -> RS232 one. Let me check my files and see what I can post. What version are you using?


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 5 of 6
(4,823 Views)
Here is a vi that worked in my case. It is an action engine, meaning a vi that can be used in multiple locations in your program, with each instance remembering the settings from the previous instance. Eg., If you call this vi early in your program and select the "serial method" initialize then subsequent calls to the vi doesn't need to have the comm params fed in, as it will "remember" the settings. It works, as I recall and looking at the code (amazing what you will forget, this one was really a pain at the time) by setting the parity to "mark" or "space" depending on whether the message being sent is an address or a message, at least in the use that I wrote it for. In my case the timing was very critical, such that running it in LabVIEW 6.1 caused random errors, LabVIEW 7.0 not.  After the data was sent the parity was set back to none. I haven't used it since then, don't remember the details (there is a case in the receive case that is set by a constant, think it is left over from debugging.) but here it is such as it is.

If you have any additional questions feel free.

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 6 of 6
(4,818 Views)