Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Newbie help with VISA and temperature controller

Sorry if this is too basic of a question but I am trying to learn about using the VISA.

I am very new to LabVIEW. I am using version 7.1 and 8.0.

What I am trying to do is read the actual temperature from through the rs-232 serial port. The controller we are using is a Wavelength Electronics LFI-3751. I have made all of the necessary wiring harnesses and have wrote the program that I think should work. I can read the temperature on the number 1 controller with no problem. I can change the address on the controllers to number 1 and read each unit with no problem.  We have 9 of these units and when I change the address on the program to match the unit numbers, I can turn them on the lights blinks that it is sending the packet but I am getting back 000.000 for the temp. If anyone would have an Idea or suggestion please let me know. I have included the VI that I am trying to use as well as the VI that came with the controller. I could use the VI that came with the controller but there are a lot of extras that I don’t need. I am trying to log other information as well with this VI.

Thanks

G

Download All
0 Kudos
Message 1 of 8
(4,292 Views)
The first thing you can do is create an indicator at the VISA Read output, run the VI, go to Operate>Make Current Values Default, save the VI, and repost it. That way, someone can look at what you are actually getting back from the instrument. The scan from string looks a little odd with you using the Remaining String output. The other thing you can do is post all of the subVIs of the driver you got. Just posting the main VI does not include the important stuff - like how the vendor wrote the code to take a measurement. Do a save with options and select Development Distribution to create an llb. The other thing you want to do is remove every single sequence structure and use the error in/error out connections to enforce data flow. I have no idea if you have automatic error handling turned on but even if you do, it's better to use data flow instead of the sequence structure. Use the Delay function instead of the Wait (ms) to get a time delay function that has error in/out connections. I also don't understand why you have Write LabVIEW Measurement File in the top while loop instead of the loop that acquires it but that has nothing to do with your problem.
0 Kudos
Message 2 of 8
(4,281 Views)

I have attached the files requested. On the Chamber 2 in the block diagram I put a note to show what I have changed to switch the address and ran it as well and saved. I will work on changing to time delay and I do have the automatic error handing on. If you would like anything else please let me know.

Thanks

G

0 Kudos
Message 3 of 8
(4,276 Views)
I'm going to assume that the actual temperature is the + sign with the following numeric and that the 8 digits before that, have something to do with the chamber. If that's the case, if you use a format string of "@8d%f" (no quotes), then the Scan From String will return a numbr equal to the termperature no matter what the chamber prefix is. You can then convert this number to a string. I'm confused though, about the write string. What is the format for addressing the correct chamber? I suspect you can build this string dynamically so all you have to do is select one thing (address, chamber, whatever) but I don't have enough information to do this for you.
0 Kudos
Message 4 of 8
(4,270 Views)

I tried that VI and it looks good but it would only give me a reading 1 time. And it would not work when the address was changed to the other chambers. The ultimate goal is to take a reading on the light intensity and the temperature with the date time stamp once per hour. The attached data is how the address works according to the book and again it does work with #1 but when changing the Unit # is when I get into trouble. With the command code you can get resistance, Thermoelectric current, and a whole number of other reading back.  

Thanks

G

0 Kudos
Message 5 of 8
(4,264 Views)
Yes, that is why I said you have to create the command you send with the VISA Write dynamically. I would suggest you look at the subVIs in the driver. I found one called BuildCmd that seems to work. There's also a whole bunch of read functions. You may not want to use the top level VI you got but I would recomend you use some of the subVIs and not have to re-invent the wheel.
0 Kudos
Message 6 of 8
(4,259 Views)
Hi,

1) I should suggest to start trying to read the serial number of the
units in a first attempt to read anything

2) If you are able to read a single unit with an address different from
1 your program is ok

3) if you can read the S/N of unit of address 2 and add address 1 it
may work definitely with 9 ...

FG

0 Kudos
Message 7 of 8
(4,250 Views)

Thanks for the help. I did get it working. The comment about reinventing the wheel just finally sunk in. After doing some tracing I found the read measurement vi in the library and made a connector then incorporated it into my program. Works great. I have attached a copy to show what I did.

Thanks again for the help.

G
0 Kudos
Message 8 of 8
(4,231 Views)