From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progammically Set DTR to DSR and RTS to CTS?

Solved!
Go to solution

I am trying to communicate with an extech power analyzer with Labview.  Thier data logging software and cable all work.  According to the manual.  I need to tie RTS to CTS and DTR to DSR. 

 

I am trying to use the Visa commands.  Visa Serial, Visa Read, and Visa close for now.  

 

How can I programmically do this? 

 

Thanks

0 Kudos
Message 1 of 14
(7,981 Views)

You can Set the DTR and RTS states.  You can only Read the CTS and DTR states.  (You can also read back the DTR and RTS states).

 

See attached using Property Nodes.

 

You can't actually tie the lines together in software,  that is done in the cable.  But if the cable works with their software, perhaps all you will need to do is assert the DTR and RTS lines in your LV program.

Message Edited by Ravens Fan on 03-11-2009 03:59 PM
Message 2 of 14
(7,979 Views)

Kyle,

 

The connections between RTS-CTS and DTR-DSR should be already made by the cable.  You can verify this by disconnecting the cable and using an ohm meter to measure resistance between these pins.

Message 3 of 14
(7,978 Views)

I checked the cable and the pins are not connected.  The manual notes:  "Software developers must ensure that DTR provides 10V (or higher) and RTS provides -10V (or lower).  Voltage (10V, -10V) from DTR and RTS is used to generate the RS-232 signal.  DTR is usually enabled (10V) but RTS must be disabled in order to provide -10V. "

 

I keep getting error 1073807339 and tried the  property node.  I toggled the unasserted and asserted states also. 

 

Any other ideas?  I ordered some parts to build a cable, but was hoping to do this programmically.

 

Thanks

0 Kudos
Message 4 of 14
(7,964 Views)

Then change the constant going into the RTS node to unasserted.

 

If their cable works, then you can use it.  Their software is setting these lines as needed.  You just have to figure out what are the right line settings and do it  in your LV program.

 

The error code is a timeout, probably because the device didn't respond when it didn't like the combination of RTS and DTR you had.

Message 5 of 14
(7,954 Views)

I tried all combinations of the DTR and RTS states (9 of them) and still can not communicate.  Any other ideas? 

 

 

0 Kudos
Message 6 of 14
(7,940 Views)
IF the cable is wired correctly and IF you have programmed the line states correctly, then the most likely reason for a timeout is that you have not set the termination character correctly for the VISA Configure Serial Port function. One of the inputs to this VI is whether to use a termination character, and if one is used what that termination character is. This is used by VISA Read to know when it can stop reading if you do not use the VISA Bytes at Serial Port to determine how many bytes are available to be read. Take a look at the serial read/write VIs that ship with LabVIEW to see how this is done.
Message 7 of 14
(7,926 Views)

When you post an image, make sure you attach the image file to your post first.  Right now your image is located on your hard drive, so we can't see it.

 

Attach image file.  Submit post.  Edit post,  Insert image based on the link to the image file on the Discussion forums.

Message 8 of 14
(7,911 Views)

Here is the image.  I turned the termination character off but tried several terminations characters with it on.  I don't think that is the problem.

 

Visa line control

Message Edited by kyle vi on 03-12-2009 08:27 AM
0 Kudos
Message 9 of 14
(7,882 Views)
Solution
Accepted by topic author kyle_vi

First, change the RTS to unasserted since you said the RTS needs to be -10V..

Second, all you are doing is reading from the port.  Do you have any manual that talks about the serial communications protocol?  Does the device send data continuously or are you supposed to write a command to it then read back the response?

Message 10 of 14
(7,878 Views)