ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

COM RS232 problems

Im opening my com port trough MAX and the VISA test panel and I have to change the attribute "Flow Control Settings / Data terminal ready DTR" from Asserted to Unasserted in order to be able to write the data I want to write to the RS232 device using the input output window. While doing that I have NI I/O scope running and can see that the data I write is in the buffer and my device reacts as I wish.

I now wrote an VI that does exactly the same, I set the COM port and change the DTR setting through the property node. I can see the change in the NI I/O scope and then I write the same data again into the device again seeing the buffer in the NI I/O scope. But the data is not written correctly into the device. 

The only difference I can see in the NI I/O scope is that in the first case the COM port ist being addressed like "

28. viSetAttribute (ASRL7::INSTR (0x0375A008), ASRL_DTR_STATE, 0)
Prozess-ID: 0x00000B90 Thread-ID: 0x0000129C
Startzeitpunkt: 16:10:51.259 Aufrufdauer 00:00:00.000
Status: 0 (VI_SUCCESS)

"

and in my vi it shows up "

780. VISA Set Attribute ("COM7", 0x3FFF00B4, 0)
Prozess-ID: 0x00000FA0 Thread-ID: 0x00001388
Startzeitpunkt: 17:04:49.730 Aufrufdauer 00:00:00.000
Status: 0 (VI_SUCCESS)

"

 

Can this whole problem be in the way the system addresses the functions in each case?

MEnaing once using viSetAtribute and the other time VISA set attribute and then ASRL7::INST and then COM7?

0 Kudos
Message 1 of 3
(2,623 Views)

COM7 is th alias of your com port, and ASRL7::INST is the actual resource name.  In MAX, if you go to tools, NI-VISA-VISA optoin, and Aliases, you can see all the alias for your com ports.

 

If COM7 is the correct alias for your com port, you shouldn't have a problem.  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 2 of 3
(2,605 Views)

Thank you for the answer.

Yes i do know that it works that way but since it is one of the two differences i thought maybbe it had something to do with my problem.

 

0 Kudos
Message 3 of 3
(2,581 Views)