Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA-driver not send string from COM port first time , if it contain odd bytes

Solved!
Go to solution
VISA-driver does not send string from COM port  first time , if it  contain odd bytes
0 Kudos
Message 1 of 9
(3,231 Views)

Hi alexart,

 

Can you give me a bit more information about your issue? One, with what device are you trying to communicate with, and how are you communicating with it? Are you using our VISA Interactive Control? Are you referring to a specific VISA command, or are you saying that you are unable to send any VISA command if it contains an odd number of bytes? Your responses to these questions will be extremely helpful for me to help resolve your issue. Thanks!

Justin E
National Instruments R&D
0 Kudos
Message 2 of 9
(3,220 Views)
I use LabLiew example for write data to Com port CompactRio. I send string wich have odd bytes(not only  ASCII characters no LF, CR characters)  ,  I look by PC connected  by COM to COM-cRIO (no flow control) if have any data. First write  Visa operation with odd count bytes no send data from cRio com-port until next write operation or read operaration with  recieved data. No big error but I lost time to understand this problem and handle it.
0 Kudos
Message 3 of 9
(3,204 Views)

Hey,

 

So from your description, it sounds like your desktop computer is not able to see data being sent from the COM port of your cRIO hardware?  You mentioned not having any flow control enabled and your string also doesn't contain any carriage returns or LF bytes.  But the biggest concern you have is why strings with an odd number of bytes don't send but other strings of an even number of bytes send fine?  You also referenced that the VISA operation for writing sent data on the subsequent write but not the initial for the string with the odd byte count?  I want to make sure your issue is fully explained so that any solutions we offer will be beneficial.

Message Edited by David P. on 02-17-2009 11:52 AM
David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 4 of 9
(3,183 Views)

Hello!!!

I use C-prorramm on PC to listen COM-port. I run it in debug mode step by step.  I wait read procedure on PC  and have'nt any bytes, if I write odd bytes to Com port on Crio first time after initialization com-port

Wth best regards,

Alexander A/

0 Kudos
Message 5 of 9
(3,169 Views)

Hello,

 

What serial hardware are you using in the cRIO you have?  Is it the NI-9870 serial module?

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 6 of 9
(3,164 Views)
I use Com port of cRio NI-9014
0 Kudos
Message 7 of 9
(3,159 Views)

Hi Alexart,

 

I tried to duplicate this behavior but I could not. Attached is a project with a cRIO.

 

Under the PC, I have a VI "readonpc" that, when running, monitors the PC serial port and updates it's text box with the received data when it sees bytes waiting at the port.

Under the cRIO I have a  VI "writeonrio" that, when run, writes the contents of its text box out the cRIO serial port. 

 

You will have to change this projects cRIO target to match the 9014 you are using.

  1. Run readonpc
  2. Run writeonrio
You should see the text 'odd' show up on readonpc.
Message Edited by Stephen B on 02-18-2009 12:35 PM
Stephen B
0 Kudos
Message 8 of 9
(3,147 Views)
Solution
Accepted by topic author alexart

Hello!!!

Thank You for help.

I am sorry, but I can't replay that situation, wich I ask. May be I use another cRio, or may be I make mistake. I don't know what reason, but all working,

I am sorry and thanks again.

0 Kudos
Message 9 of 9
(3,099 Views)