LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO 9871 rs422 Module port read problem

Hi,

I have problems with the NI 9871 RS422 serial module. There is a device which has some switches on itself. device sends switches states information as a 72 byte  hex character using RS422 protocol and it repeats the states information every second. Bsud rate is 115200. if there occur a state changes in switches device also send 8 byte data. I want to take this information with the NI 9871 RS422 module.

VISA Read has a byte count input and I dont know what should i prefer for the byte count. device manual says device has 64B FIFO buffer. but i can write for byte count input much more. for ex. 100, 1000 i can write this values. what is the meaning of this byte count actually. And what should i do for the RS422 read vi. should i set byte count 1 and then take all the bytes one by one? if i do that can  be a problem for the speed of reading correct data. because i should use array function for the incoming data.

thanks in advance.

0 Kudos
Message 1 of 6
(3,069 Views)

The Byte Count on VISA Read is simply the amount of Bytes that will be read each time that VISA read is called. The function might return less than the number of bytes requested if the function reaches the end of the buffer, reaches a termination character, or if a timeout occurs. The output error cluster will indicate if a timeout has occurred.

 

Since the state information is a 72 byte character, I would recommend reading more than 72 bytes in order to receive all the information (for example 128 bytes). If this is too slow for you, you could break it up into smaller pieces.   

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,037 Views)

@soz wrote:

Hi,

I have problems with the NI 9871 RS422 serial module. There is a device which has some switches on itself. device sends switches states information as a 72 byte  hex character using RS422 protocol and it repeats the states information every second. Bsud rate is 115200. if there occur a state changes in switches device also send 8 byte data. I want to take this information with the NI 9871 RS422 module.

VISA Read has a byte count input and I dont know what should i prefer for the byte count. device manual says device has 64B FIFO buffer. but i can write for byte count input much more. for ex. 100, 1000 i can write this values. what is the meaning of this byte count actually. And what should i do for the RS422 read vi. should i set byte count 1 and then take all the bytes one by one? if i do that can  be a problem for the speed of reading correct data. because i should use array function for the incoming data.

thanks in advance.


NO! you do not have "problems with the NI 9871 RS422 serial module"   That hardware seems to be working fine.  You have problems using it to communicate with a third party device via VISA.  (Actually, I suspect you are using LabVIEW to call the VISA methods but...., that is so far removed from your real problem that it makes no difference!)

 

What you need to do is RTFM (Read The F$#$%G Manual) for the device that is sending the data to: understand how your program needs to interperate the data sent over the serial channel. 

 

Posting a thread that claims a generic and unnamed "device" should be programmed in a way where "anyone" could read the mind of the developer of the firmware in the device is insane.

 

If Reading the device manual is difficult select a different device. (one that has a manual you CAN read) perhaps, that firmware developer was smarter than the one that wrote the com routine for your device.

 

 

And then you PM'd me?  you deserve the mild chastisement.  Did you READ the e-mail sent to you about how to use the forums?  Hit some links near you! 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(2,936 Views)

Jeff seems to be in a bad mood today, despite it being a holiday.

 

 


@soz wrote:

Hi,

There is a device which has some switches on itself.


What device?  What is the exact protocol?  If there are multiple types of messages that it can send, there is usually a byte or two telling you what type of data it is sending.  You then are responsible to interpret your data correctly.

 

What have you tried so far?  Please share some code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(2,931 Views)

@crossrulz wrote:

Jeff seems to be in a bad mood today, despite it being a holiday.

 

 


Well not really a "bad mood" but ....  When my "Droid" got reset yesterday the sound settings did not quite get reset to what I expected.  so, the auto-generated email that I had recieved a PM on the forums interupted my sleep.Smiley Very Happy

 

damned droid- 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(2,926 Views)

Jeff·Þ·Bohrer wrote: so, the auto-generated email that I had recieved a PM on the forums interupted my sleep.Smiley Very Happy

Ah, so it is "cranky".  My bad.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(2,923 Views)