LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remote Control for an External Instrument

Hi,
 
I need to control a Cecil CE3055 Spectrophotometer using a series of 16-20 ASCII commands through RS-232. 
 
Any suggestions on the easiest way to start?
0 Kudos
Message 1 of 16
(3,767 Views)
You will probably have to write your own instrument driver, which isn't really difficult to do. There's tons of examples on the NI Instrument Driver Network that you can use as a template. My suggestion is to make a separate VI for each command as that will make integration easier.

The company seems to have this application that you can use to collect data and put it into Excel. You may wish to contact them to see if it has an ActiveX interface. That may be another option, though the overhead is going to be substantially larger than writing a few VIs to implement the commands the instrument uses.
0 Kudos
Message 2 of 16
(3,752 Views)
Since NI doesn't have a driver for it, the first thing I would do is check with the vendor and see if they have a driver. If that doesn't work out, I always start by opening the programming manual and use Hyperterminal, Procomm, or any other terminal emulator. If it works there, then you know you have the right comm settings and cable. After that, it depends exactly on what you want to do. The Instrument I/O Assistant can be used for serial instruments. This won't be as flexible as a driver but it will work fine for many simple tasks. You can also look at the shipping examples called Basic Serial Write and Read and Advanced Serial Write and Read. Please take note of how they handle the (usually required) termination character at the end of the write string. The basic example uses a '\' character display for the string command and embeds a term character at the end of the string. The advanced example uses a VISA property node to set the VISA Write to automatically send it with each write.
0 Kudos
Message 3 of 16
(3,750 Views)

I've used the Instrument I/O Assistant previously, but with less involved machinery on the receiving end.

I'm not receiving a Code Generation Type, leaving me unable to apply a VISA Code Generation.  As expected I receive an Execution Error: Timeout expired before operation completed - VISA; Status Code - bfff0015.  I increased the Timeout value but received the expected error again cause I am not given an option for Code Generation.  I selected the instrument COM1, and I know it's hooked up in the right COM slot so that can't be the problem.

Any reasons for this?

Thanks

Message Edited by Steve.Briggs on 11-20-2006 11:24 AM

0 Kudos
Message 4 of 16
(3,744 Views)

I don't know what you mean by Code Generation Type. Where do you expect to see this? I'm not a big fan of the assisant's capabilities in 7.1 so I've only played around with a couple of times but I don't remember anything like this.

You may have the instrument connected to the correct port but do you know if it's connected correctly? Have you tried it with Hyperterminal?

0 Kudos
Message 5 of 16
(3,736 Views)
When I first go into the Instrument I/O Assistant it tells me to select an instrument with choices: COM1, COM2, and LPT1.  I select COM1, the port I am connected to, then it tells me to select the Timeout(ms) which is set to default at 2000.  The next step is to choose Code Generation Type, but it is greyed out and I cann't select or open the pull down menu.  I can see it says VISA Code Generation, but it doesn't let me select or open the menu.  So I skip agead to the Query and Parse step, which is where I receive my error.
 
I can't really see how I am connected wrong, but I'll play around with Hyperterminal and see if I can get it to work.
 
 
0 Kudos
Message 6 of 16
(3,728 Views)

Okay, I see that now. I had 7.0 open and it's not there. I have no idea what this is for but I can't select it either. VISA Code Generation should be the only option you have and there should be no reason to change it.

There are many ways to be connected incorrectly. The baud rate, parity, data bits, etc., could be incorrect and the calbe may be miswired. Some instrument require a null modem cable where the TD and RD lines are swapped between the instrument and the pc and some instruments use a stratight through cable. You can also get a timeout error if you send an incorrect command in the query and parse or if you choose an incorrect termination character.

0 Kudos
Message 7 of 16
(3,720 Views)
You're right again Dennis.  I was messing around with the input command and had to choose between \n, \r, \t, <none> for Termination characters and it was on default (\n).  Changed it to \r and now its working.
 
Thanks
0 Kudos
Message 8 of 16
(3,716 Views)
Ok.
So what I thought would be a fairly simple process is turning out to be more and more difficult as my attempts continue to fail and fail.
 
I've come to the conclusion that nobody is really familiar with the Cecil CE3055 Spectrophotometer that I am using so I'll provide this visual of it: http://www.dialspace.dial.pipex.com/cecil/spec-3.htm
 
When beginning the Instrument I/O Assistant I am able to Select the Instrument with ease and I then try and Query and Parse/Write in order to talk to the spectrophotometer.  Through Query and Parse I send a few simple commands that I know are valid instrument commands (*IDN?, ?BAS, ?STP, ?AZO, ?SCU) and this works fine.  The value on the Instrument I/O Assistant matches the value from my spectrophotometer.  The main problem comes with Write and Read and Parse.  I try to send a Start Scan and/or Store a Baseline command to the meter but I receive an Idle message through the I/O Assistant and my meter tells me that it cannot accept this; eventually the command times out and I receive the same execution error as before.
 
NI didn't have an instrument driver for this particular meter/company so I contacted the company and they don't have one either.  In fact they are completely against LabVIEW for some odd reason...
 
I even tried to skip a few processes and just Selected the Instrument, performed the necessary steps manually on the spectrophotometer and then attempted Reading Data from an Instrument, unfortunately I receive the same execution error for time expiring before operation completed : VISA - Status Code: bfff0015
 
My question here is if anyone is familiar with the Cecil CE3055 Spectrophotometer, and if anyone can help me with my issues  in Instrument I/O Assistant
0 Kudos
Message 9 of 16
(3,694 Views)
I've come to the conclusion that the Instrument I/O Assistant cannot do what I need it to do with the settings I have on this machine.  The spectrophotometer has to be set in RS232 Control mode, but the Instrument I/O Assistant returns an Idle message and Error pop-up (Execution Error: Failed to open a session with the selected instrument.  Error message: The resource is valid, but VISA cannot currently access it.  VISA Status code bfff0072).  However, this does not make sense to me because I am fully functional (Read and Write) in Measurement & Automation Explorer. 
With that being said, I am going to forget about Instrument I/O Assistant and tackle this thing with a custom driver or set-up of string commands.  Through MAX I was able to set up my entire process of 12 commands and it worked as if I was doing the entire process on the spectro's board.  I just need to incorporate my 12 commands (string?) into one or multiple VIs in LabVIEW.  It was suggested before to use a driver, but NI and the company do not provie one, and also to create my own, which, in turn, I am not familiar with.  I noticed mutliple commands in Instrument I/O >> Serial, that could be of use.
 
Any and all help is greatly appreciated...
Thanks Smiley Very Happy
 
P.S.  I am 100% certain that I am corrected properly.  (9600 - N - 8 - 1)
0 Kudos
Message 10 of 16
(3,659 Views)