LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

arc monochromator driver

hi john,
i tried the subvi which u send to me. i use all the vi,ie to change wavelength, grating etc, but all returnet with same error (error code 37). That is no device is found.But when i send a string using basic serial read and write i am able to recieve the data.so it mean there is communication with instrument.can u give some help to remove this problem.
thanks.
josan
0 Kudos
Message 11 of 22
(1,749 Views)

josan,

That vi is not intended to be a standalone vi.  You need to make sure that you're using the right serial port and that you have properly initialized the serial port (make sure the settings are right).  Make sure that you're using the correct COM port number.  If the device is connected to COM 1 then the COM port number is 0, not 1.

Also, as I said before this vi is written for an old ARC monochromater and there could be some variation in the command set, although it's probably not much different for these simple tasks. 

John
Message 12 of 22
(1,689 Views)
john,
ya the serial port is properly intialized.as i have said earlier i used basic serial read and write.vi and i was able to recieve data when i send a command like nm ,etc.
so i think there is no problem in communicating with instrument and intialization.
still what u suggest thatt i should do  to check the port. moreover we have only one serial  port in system that is com1. and in the vi's i use port no 0.
so if i have to do some variation in vi,what are they and how to do it.
 
thanks
josan
0 Kudos
Message 13 of 22
(1,691 Views)
josan,
 
When you say "i was able to recieve data when i send a command like nm, etc." how are you sending that command?  Are you sending the command in LabVIEW?
 
There is also a possibility that the timeout needs to be increased.  Have you tried running the vi in debug mode (with the light bulb on)?  This runs the program slowly, showing you the results at each step. 
 
You should look into the vi and make sure that the syntax is the same as what you received from ARC.  It probably is, but I would check it to make sure.
 
John 
Message 14 of 22
(1,692 Views)
john,
i am sending that command using  labview vi's example named,basic serial read and write vi. yes i am sending the command in labview.
 
the serial port is intialized becz i have one more vi in the file arc-spectra_sdk send by some ni guys 2-3 months ago. in this whole lab view file only one vi works( named setup-mono) that is to change wavelength.
i have changed the wavelength of instrument using this vi.i am attaching that file.
i dont know what are rest vi but only one is useful.
 
so if u think i have to increase time ,so how should i increase it and from where.
thanks
0 Kudos
Message 15 of 22
(1,687 Views)
josan,
 
If you look at the example vi that you're using you'll see that they go through an initialization stage.  The vi that I sent you doesn't do this since it is intended as a subvi of a larger program.  You need to set up add the "Configure serial port" portion of that code to the code that I sent.
 
I don't know what the code that you attached does because it's really just external code wrapped in a LabVIEW interface.  I believe that using the serial commands directly will be a simpler approach.
 
What you will normally do is configure the port at startup, run everything in a loop until exit, and then close the port at shutdown.  This is the approach that I took in my program since I didn't want to be opening and closing the port every time I try to write to it or read from it.  I suspect that this is the problem and not the timeout.
 
John
Message 16 of 22
(1,681 Views)
john,
 
i think u are right this may be the problem. but as i didnt know much can u plz tell how should i 

 "Configure serial port" portion of the code to the files which u send me .

i mean how should i configure the port at startup and end while shutdown

thanks

0 Kudos
Message 17 of 22
(1,676 Views)
josan,
 
There are several ways in which you can do this.  One way that I like is to use a state machine architecture.  Look at the LabVIEW examples for state machines.  This is likely a good approach for your application.  You could have states such as "Startup", "Move Monochromator", "Change Grating", etc., depending on your exact application.  Once again, the approach depends upon the application.
 
You could also do something as simple as open it before the main loop and close it after the main loop (you can control execution using data flow).
 
If you want to just try it to see if it works copy those portions of the code from the example that you were using which you know works. 
 
Let me know if this helps.
 
John
Message 18 of 22
(1,672 Views)
john,
i have check the vi example and found  only one vi ,named state machine check sequencer.vi  and it result uut passed after running.
meanwhile i talk in the morning to an ni represantative and shown the files which u have send to me. he also talk abt the same thing that i have to configure the serial port to use that arc file. he said u better can assist abt that thing. he said he had send  vi to configure the port in my email ,but i dint get it. so how should i configure port to use that arc files.
thanks
0 Kudos
Message 19 of 22
(1,660 Views)
I see the problem now.  This is an old vi which does not use VISA for serial read/write.  I suggest that you go through the subvis and replace all of the read/write vis (the NI vis that are black and white) with VISA read/write vis.  Then you can use the VISA Configure Serial Port to set the serial port up.  You also need to change the serial port in and out to VISA references. Unfortunately I'm busy with clients this afternoon and have reports due next week so I can't rewrite this for you.  I hope that this will help you get a start.
 
By the way, have you gone through any of the LabVIEW tutorials?  These are very helpful in learning how to program in LabVIEW. 
0 Kudos
Message 20 of 22
(1,655 Views)