LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between Labview 8.2.1 and TDI XBL Dynaload via RS232

Hi,

 

I'm have a new DI XBL Dynaload 50-150-800 (an electroinic load)  that I'm trying to communicate to with Labview (8.2.1) via a RS232 connection but I am having trouble because the Dynaload is not responding to commands given in Labview. I've checked the manual of the Dynaload and it seems like all the commands we've entered are correct. I contacted TDI and they recommended delaying the time that the characters are sent and to put carriage returns at the end of the data stream but even with all of this, the dynaload is not responding. The TDI was even sent back to New Jersey for a firmware revision. I've also tried downloading a driver for Labview from the TDI website and still nothing. the Dynaload seems to work just fine when I talk to it via Hyperterminal. I'm going to keep trying until I get it to work but if anyone is willing to help or at least point me in the right direction, I'd GREATLY greatly appreciate it and then I can provide more details about the situation from there. 

 

Thank you.  

 

Best Regards, 

0 Kudos
Message 1 of 14
(3,686 Views)

Are you getting any error messages in your VI?  Of course double check that the serial port settings you configure in your VI match those that are working in Hyperterminal.  And that the com port has been closed in Hyperterminal before running your VI.

 

I would recommend you post your VI and also any link to the devices instruction manual.  Then it would be easier to suggest some changes to try.

0 Kudos
Message 2 of 14
(3,677 Views)

Thank you very much for your quick response.

 

The error message I receive when I attempt to run my VI is as follows:

 

Error 1 occurred at Scan From String (arg 1) in filename.vi

 

Possible reason(s):

 

LabVIEW: An input parameter is invalid. For example, if the input is a path, the path might contain a character not allowed by the OS such as ? or @. 

 

It appears as though, Labview is not liking the input on the 'Scan From String' block (you can see this block in the attached screenshot titiled 'Error Message')

 

 

I've also added some screenshots of the error and the VI block diagram for the device. Please excuse the quality (screenshots were pasted on Microsoft Paint as JPEGs). See attachments. 

 

I'll also attach the PDF manual for the device (TDI XBL Dynaload electronic load) in my next post (since this forum only seems to let me attach 3 files at a time). The XBL commands and queries are listed in a table on pages 46-50 of the manual. The commands used in the VI can be seen in the attached screenshots and are located within pink boxes (i.e.- 'RNG', 'VL', 'IL 95', 'CI0', 'TEXTOFF', etc). These commands are the same commands listed on pages 46-50 of the manual. 

 

Just a few other notes:  

 

-communicating to the device via Serial RS232 cable

-responds to commands just fine in Hyperterminal 

-device located on COM2

-baud rate for device: 9600

-termination charcater enable set to false

 

 

 

 

 

 

 

 

0 Kudos
Message 3 of 14
(3,656 Views)

In the attached file, you will find the manual for the device. 

 

Please let me know if you need any further clarifcation on any of the information presented and thank you in advance for your help. I greatly appreciate it. 

 

Best Regards 

0 Kudos
Message 4 of 14
(3,652 Views)

After a quick look, my first thought is that you have an issue with the termination character.  You are sending a carriage return.  Try a carriage return then line feed.  Take a look at the trouble shooting section on page 40 of the manual.

 

Note, if you want to simplify the code a little bit, instead of concatenating the end of line characters (CR and/or LF) to your command string, right click on the command string constant and select \ codes display.  Then you can directly enter a \r (for carriage return) and a \n (for new line or line feed) right to the end of the constant.  It will save you some screen space.

Message Edited by Ravens Fan on 03-04-2009 12:21 PM
0 Kudos
Message 5 of 14
(3,645 Views)

Thank you for your response but I'd like to clarify your instructructions. Please bare with me as I am new to using LabView and I'm not the orginal programmer of this VI. 

 

I did as page 40 told, and set CR to CR-LF (carriage return, line feed). Then tried to run the VI and still got the same error message as before (invalid input parameter for Scan from String block). 

 

Also, which command string contant should I right click on so that I can select '\ Codes Display'? Were you refferring to the pink box labeled '%f' located aboive the Scan from String block? (I've attached a photo and circled the block I'm referring to). Also, once I've selected the '\ Codes Display', do I just manually enter \r and \n into the text box above the block, after where it says '%f'. Can you please clarify this for me?

 

Once again, thank you very much for your assistance.

0 Kudos
Message 6 of 14
(3,631 Views)

For the \codes, I'm talking about the string constant that you feed to the VISA Write to tell it the command you want to execute.   Doing it like this will save a bit of block diagram space.  This one shows it with a carriage return-line feed combination.

 

I think the error that you get on the Scan from String node is due to an empty string coming out of the VISA Read.  Possibly due to an incorrect termination character on the string you are writing to it.  1.5 seconds seems like it should be more than enough time to turn around the message.  Since you said it worked when you used hyperterminal, I'm wondering if Hyperterminal is set to send the CR/LF when you hit enter after typing the command.  I would recommend dropping in some probes or temporary indicators on the string that comes out of the VISA read and the error wire.  See what kind of data or error is coming out before it is sent to the Scan from String function.

 

One thing that confuses me about the manual is that they show most commands ending with a <NR2> and a handful ending with <NR1>.  They never state exactly what either one is, or what the differences are between them.

Message Edited by Ravens Fan on 03-04-2009 01:42 PM
0 Kudos
Message 7 of 14
(3,623 Views)

I've replaced the concatenated strings with carriage return-line feed combinations, as you suggested. I've attached two screenshots of the VI so that you can see what I've changed. However, when I ran the VI, I'm still receiving the same error on the Scan from String node. 

 

Also, on Hyperterminal, typing CR/LF and hitting enter did not return anything.  

 

I would like to try dropping some probes and temporary indicators but I'm not sure how to do this. Can you please assist me? 

 

According to the manual on page 42...

 

<NR1>=  Digits with no decimal point. The decimal point is assumed to be to the right

of the least significant digit. For example: 314, 0314.

 

<NR2>= Digits with a decimal point. For example: 314.0, 31.41, 0.0314 

Download All
0 Kudos
Message 8 of 14
(3,606 Views)

Typing CR/LF and hitting enter in Hyperterminal won't do anything.  CR and LF are just the notations for the carriage return byte and the line feed (or new line) byte.

 

If you hit CI? then enter in hyperterminal, you are actually sending the bytes C I ? and then either a carriage return, or line feed, or a combination of both (either CR then LF,or possibly LF then CR)

 

To put in an indicator, right click on a wire of interest (such as the error wire coming out of the VISA read) and select create indicator.  To put a probe, which is an on screen floating window of the value, right click and select probe.

0 Kudos
Message 9 of 14
(3,599 Views)

Thank you for the recommendations.

 

I've put indicators and probes on the input wires of the Scan from String block but they are not telling me anything new. Is there anything else that you can please recommend? Perhaps, I'm putting the indicators and probes in the wrong places?? 

 

Once again, I really appreciate your assistance and patience.  

0 Kudos
Message 10 of 14
(3,581 Views)