LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an exe with 6.1 and VISA

Steven,
I installed the development environment on my W98 machine. The exe application still does not communicate, so I tried running the vi, which also does not communicate.

The loopback test that you referenced makes use of hyperterminal. This test is not necessary, as I can communicate successfully with my device using hyperterminal.

I was thinking of trying a loopback test through Max, but I'm not sure what to expect. The RS485 port is configured in 2-wire tx rdy mode. I suspect the loopback won't work in this mode.

The key to understanding this problem is going to be what happens differently through hypert
erminal than through labview / visa.

Not that it will help much, but I've attached a copy of my vi. This is revision 4. I keep trying different loop structures hoping to uncover a timing issue, but multiple attempts have yielded nothing.

Thanks again.
-Jim
0 Kudos
Message 21 of 26
(882 Views)
Hello Jim,

Well, slowly I think we are getting somewhere. The next steps should also give us some valuable information.

First off, doing a loop back test through MAX would help us verify being able to communicate with the instrument through VISA on that machine. Here is a KB that talks about doing a Loop Back test with 485 Port in two wire mode.

http://digital.ni.com/public.nsf/websearch/D5CC369B3E3E6F0586256D1600563245?OpenDocument

You could also try just communicating with the instrument through MAX as well. Either way, if you right click on the port in MAX, then select Open Visa Session. Then
, select the Basic I/O tab, where you should be able to write commands out, and read commands back. If you are doing a loopback, whatever commands you right out should also be read back.

The other thing that would be interesting to try would be to see if you can communicate with your instrument on the 98 machine with an example program, such as LabVIEW <-> Serial.vi, found at the following location on your machine.

C:\Program Files\National Instruments\LabVIEW 7.0\examples\instr\smplserl.llb

Let me know how this goes and we can go from there. I really appreciate you working with me on this issue and hopefully we can figure out the cause and come to some solution.

Regards,

Steven B.
Applications Engineering
National Instruments
0 Kudos
Message 22 of 26
(882 Views)
OK. I don't have 2 ports on the W98 machine, so I set up the 2 machines to talk to each other. I first tested my connection with Hyperterminal, and everything looked good. Next I ran max on both machines. Sending from W2000 to W98 the string was received correctly. Sending from W98 to W2000 however, the string got corrupted.
Write: Hello VISA Max.
Read: Hello#VISAOax\xff

I can repeat this test, with minor variations. Usually the same characters get scrambled, but not always the same way.

Next I tried my actual command string: d01tpos\r and received d01tpos\xff which is everything but the last charact
er. This is repeatable. I tried it with and without termination characters. The termination character split a message with multiple term chars into two messages when received on the W98 machine, but the second message returns TMO. The same thing happens with multiple term chars going the other way, but with data errors on both substrings in addition to the TMO on the last substring.

I can repeat the same data errors and missing final character when receiving on W2000 using hyperterminal instead, so it would appear that W98 VISA write is not working correctly.

I also tested sending data from W2000 hyperterminal and receiving with W98 visa. In this scenario messages with multiple termination characters are received correctly, so it would appear that there is also a problem with W2000 visa write, but for some reason it didn't scramble the data.

Now, switching roles and running Max on W2000 and HT on W98, I see no errors (of course HT doesn't have TMO errors).

Feels like we're
closing in on this one. I'll be on vacation until 7/6. Please don't give up on me if you don't hear from me until then.

-Jim
0 Kudos
Message 23 of 26
(882 Views)
Hey David,

Looking at your code, the first thing that I notice is that you are only setting about half of your errors. I would first recommend setting up your code so that the error clusters are connected on every vi. Your current code setup would allow for your write VI to execute and then possibly then your event structure followed by the read. Actually these could happen in any order, because your write is not dependant of any of the information coming out of the event structure.


All you need to do is wire the error cluster out of the VIs in the event structure into the input of the w
rite VISA.


However, this just makes for a better application and I am not sure that it would actually fix your problem, but it is worth a try.


The main problem that I see is that you mentioned "The RS485 port is configured in 2-wire tx rdy mode." However, no were in your application are you setting the wire mode. This assumption means that the end user has to make these settings in MAX or the Windows Device Manager. You should add a property node after each VISA Configure Serial Port to set the wire mode. Again make sure you connect the error clusters. It should return an error if you are trying to use a standard RS232 port. If you are using any kind of handshaking, make sure you set it as well.


Hopefully, this will fix your problem.


JoshuaP
National Instruments
0 Kudos
Message 24 of 26
(882 Views)
I got a hold of the same model computer that I am running W98 on, but with W2000 installed. I put my runtime on this machine to learn something about the operating system's influence.

This test communicates with my device, but not perfectly. The configuration is not identical to my development machine - this test machine has a newer serial driver and newer visa runtime. Spy capture file is attached.

To summarize: application communicates when run on development machine running W2000, communicates somewhat on test machine running W2000, but not on target machine running W98.

Also, comm
unication tests run with MAX and hyperterminal show that data is being corrupted by VISA write operation.

I read the comments of JoshuaP, but did not respond directly to those comments. I think he has very good programming tips, but I wish to focus on the isolated test using MAX and Hyperterminal, which is independent of the program.

Thanks again.
-Jim
0 Kudos
Message 25 of 26
(882 Views)
Please reference the new thread here:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HFORCEKWTID=110298:5&HOID=50650000000800000032E70000&HExpertOnly=&UCATEGORY_0=_201_%24_13_&UCATEGORY_S=0

Craig H.
NI Applications Engineering
0 Kudos
Message 26 of 26
(882 Views)