Jump to content

Serial Comm : Hyper Terminal Works; LabVIEW not!


Grey

Recommended Posts

Hi,

I’m in the process of communicating a device through serial port.

Before I start the LabVIEW program I verify through HyperTerminal.

That’s working.

When I try to use the LabVIEW program it gives an Error.

I tried to check all the possibilities in the program and I’m not able to figure out what went wrong?

Even through MAX also giving the error.

I tried multiple times of trial at Hyper terminal it works fine. No issues.

In program after the command I used \r\n but no improvement. (I tried different combination \n\r and \n and \r and \r\n )

Here I given the settings of Hyper terminal for your reference and vi too attached.

Please help.

post-17856-0-65866300-1334300454_thumb.p

post-17856-0-47895700-1334300468_thumb.p

Serial Comm.vi

Link to comment

So where actually does you VI go wrong ? Does it connect OK ? does it time out on the read or write ? can you provide the error message

I tend not to use the the basic visa read on it own as you have done. I always use it alongside "Bytes at port" inside a loop and the whole thing in another loop to look for a matching termination character.

post-7256-0-20809600-1334305602_thumb.jp

Link to comment

How long does the reply take in the hyper term example, and what time out are you using on the read, it might be worth playing with the VISA timeout value on the configure serial VI.

Also if you do a goggle search on "labVIEW serial error -1073807339" you will get a number of existing threads on here and ni.com that might help

Link to comment

How long does the reply take in the hyper term example,

When I hit enter using the command in hyper terminal the result strings come immediately. The response is approx less than a second.

While I use in LabVIEW, it waits for few more seconds and I got the time out error message.

How long does the reply take in the hyper term example, and what time out are you using on the read, it might be worth playing with the VISA timeout value on the configure serial VI.

Also if you do a goggle search on "labVIEW serial error -1073807339" you will get a number of existing threads on here and ni.com that might help

Ok i will have few trials on timing.

same time i will check "abVIEW serial error -1073807339" too.

thanks

Link to comment

This doesn't look the right kind of error for this, but be sure and disconnect the communication with HyperTerminal before trying to open the port in LabVIEW. If you run both at the same time LabVIEW will not be able to get a lock on the port because another application is using it.

Link to comment

Since you are using XON/XOFF flow control, perhaps the control character is not being set to the correct character. Check the documentation on your device for what the XON/XOFF characters are. You can change this setting by using a property node. It is in Serial settings -> XON flow control character, and Serial settings -> XOFF flow control character. Additionally you can manually set the flow control state to force it to something on your end, but since the read is failing, this probably wont help you.

Link to comment

One more thing, you are sending "N?\r\n" I'm gonna assume that this is using codes display. Your VISA Configure is adding a "\n" to all writes for you. It might be in your best interest to turn this off. The actual data on the line will be "<XON>N?\r\n\n<XOFF>" If you want additional control over the line (which I've done before to debug this exact situation) turn off flow control entirely, and manually put all the data on the line. If your xon char=0x11 and xoff=0x12, then your codes display to send for that message would be:

/11N?/r/n/12

In hex, the data would be:

2F31 314E 3F2F 722F 6E2F 3132

Hope this helps

Arg, i put the slashes in the wrong direction

Codes Display:

\11N?\r\n\12

Hex:

114E 3F0D 0A12

sorry about that

Link to comment

I just right now was making a serial comms VI library to talk to an instrument and for some reason the VISA line feed auto-append (termination character) didn't do it for me, although Hyperterminal will do the same thing and it worked.

I just concatenated the "line feed constant" from the string palette with each of my commands when writing, then it worked fine.

Link to comment

Since you are using XON/XOFF flow control, perhaps the control character is not being set to the correct character. Check the documentation on your device for what the XON/XOFF characters are. You can change this setting by using a property node. It is in Serial settings -> XON flow control character, and Serial settings -> XOFF flow control character. Additionally you can manually set the flow control state to force it to something on your end, but since the read is failing, this probably wont help you.

It supposed to be "Hardware" instead of XON/XOFF.

I tried in hyper terminal using Hardware as well as XON/XOFF option. it's working.

In VISA com port init configuration i'm not finding the hardware option.so i'm trying XON/XOFF.

check the screenshot please !

Thanks.

post-17856-0-18062800-1334568655.png

Link to comment
  • 2 months later...
  • 1 month later...

You can try this also for the Hyper Terminal

http://lavag.org/fil...hyper-terminal/

Hello,

I tried the Hyper Terminal code that you wrote but I was not able to communicate with my device.

I have a Omron E5CN Temperature controller that I want to use with Labview.

I am able to communicate with this controller using Omron's Thermomini software.

MAX is able to validate the and open a session with the device. The controller is connected via a RS232 to USB converter.

Any advice on how to use this controller with Labview?

Link to comment

Hello,

I tried the Hyper Terminal code that you wrote but I was not able to communicate with my device.

I have a Omron E5CN Temperature controller that I want to use with Labview.

I am able to communicate with this controller using Omron's Thermomini software.

MAX is able to validate the and open a session with the device. The controller is connected via a RS232 to USB converter.

Any advice on how to use this controller with Labview?

The controller isn't RS232. It is RS485 (according to the docs). Therefore hyperteminal or equivalent will not work. Looks like it has two modes of operation. CompoWay/F and Modbus. Modbus is an industry standard and, if you have the NI DCS module, you can set it up with the OPC server. Alternatively you can use the VIs I linked.

Edited by ShaunR
Link to comment

The controller isn't RS232. It is RS485 (according to the docs). Therefore hyperteminal or equivalent will not work. Looks like it has two modes of operation. CompoWay/F and Modbus. Modbus is an industry standard and, if you have the NI DCS module, you can set it up with the OPC server. Alternatively you can use the VIs I linked.

Unfortunately I do not have the DCS/OPC.

I downloaded the Modbus drivers from the NI site but I was still not able to communicate with the controller.

You mentioned something about linked VI's...

Link to comment

I downloaded the Modbus drivers from the NI site but I was still not able to communicate with the controller.

Did you set the controller to use the Modbus protocol?

You mentioned something about linked VI's...

Ummm. I posted a link to the NI Modbus vis which, you have now downloaded.

Edited by ShaunR
Link to comment

Yes I did set it to modbus, maybe I dont know how to use the modbus drivers, I havent attempted to use such a device with Labview so I am lost with all this machine codes !

MAX is able to validate and open a VISA session but this is as far as I can get with it.

Well.

The basics are that your PC will be a "master" on the bus (RS485 is multi-drop, meaning you can have multiple units on the same wires). You read/write to an address on the bus (the unit) and registers (memory locations) within the unit that correspond to configuration, inputs and outputs (outputs are sometimes called coils). Generally, the registers are device dependent so you will need the programming manual to identify them.

However. It would be a good idea to start another thread so that we don't hijack this one.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.