sorry, meant to point to the academics section with free online LabView courses...
You already have a block diagram, so what is the exact issue? When you have the driver (which I don't) the use the correct function (aka subvi)... And use the "cleanup tool" once in a while
You did not attach either of the subVIs, you did not provide the manufacturer of the meter, you did not provide any information as to where you got the driver, and you did not explain what happens when you run the VI.
I did mention that the instrument i am trying to program is "Newport power meter- 1931 c"
Basically i am stuck, i need to get the power readings as it shows in the actual instrument. the block diagram i attached is what i came up with.
basically i am sending a query command PM:power? which gives me power and later i am outputting it (converting it from a from a string to numeric ).
is this approach right? when i run it i get an error saying " This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input."
i appreciate your help!
Hello to all who read this,
I think I can attest to the thread starter over his frustrations. But i i would like to borrow this thread to highlight some 'quirks' with Newport devices.
I am personally using Newport's 1935-C Power Meter with 918D Photodetector IR OD3 (A newer variation of the 1931-C). I have attached the user manual and LLBs that came from Newport FTP website. The power meter basically can communicate via RS232 or USB (square port on device) to USB flat port(on PC). The Power meter i believe is not a USBTMC class of instrument and thus can only be recognised in MAX via use of VISA driver creation method for USB Raw device.
Try out #1-> USB RAW Talking: I did follow NI's tutorial on creating the USB INF files for this power meter via the VISA Driver Wizard. However, this will require complicated development of the VI for say extracting the value the power meter is measuring throught the PM:POWER? command.
Try out #2-> Going through tutorials on various levels of communicating with instruments, I understand that you could have Direct I/O, PLug and Play Drivers etc. which translates to shortest development time to longest development time and consequently varying functionality sophitication. Since Try out #1 was complicated, I decided to go with the I/O Instrument Assistant method of building a simple VI to extract the measurement. Of course this has to be done via RS232 Serial port. (I have tried using USB Raw drivers done by the Driver wizard, and having Instr I/O Asst. to find my USB instrument but it could only show me GPIB and Serial. MAX did detect the USB device.)
As I have learnt from my course instructor at NI Singapore, based in Ngee Ann Polytechnic, I set the approapriate parameters of baud rate, bit parity etc in MAX-> Serial and validated it. It was fine. I opened VISA Test panel but failed to get any explicit response from the Newport device.
I use the Instr I/O Asst to run a Query and Parse step on the COM port of the RS232 where the Newport instrument is connected. It return the bites and ASCII string. However, it was not the appropriate response as set out by Newport's list of commands in their user manual. (I have attached a screen shot of it)
Ultimate Try out-> At wits end, I managed to find the sample drivers designed by Newport themselves and place the LLB (also attached) in my instr.lib folder. The Sub VIs in the Instrument Drivers for Newport showed a few icons like Query icon, Parse Icon, Send, Read. I looked at the Hierachy diagram and noticed they use case structures and sequence structures to pass from Write to Read. But I have do not fully understand the principles behind their Sample Query VI. The Sample Query VI on its own does work off hand, but it merely alows the user a interface to query the instrument and extracting the readout.
So I would like to ask NI,
1. Could the weird Query and Parse observation be due to hardware or the lack of support by NI's Instrument I/O Assitant? (version 2.4 was used). The conclusion i have is that I am not getting the appropriate response after parsing (evident when the byte index is 0, ASCII string is the command i sent out). If the Instr I/O Asst. were to work as it would have, then things will be simpler in developing the VIs for my purpose of extracting readouts at fixed intervals and plot on a Graph chart within Labview.
2. How can I proceed from here after "banging" walls in trying to communicate with the device? Newport has no proper step by step into using their sample Labview drivers.
Appreciate it if someone could provide some input.
Nanyang Technological University
I am sorry to hear about your frustrations. I don't think there is any inherent incompatibility with the Instrument I/O Assistant. Serial communication is almost always just a matter of knowing the right commands to send. I understand that sometimes this is a lot more complicated to put into practice than it seems, but there are usually not any problems with incompatibility (unless Newport does something non-standard with their RS-232 port).
Does the VI library from Newport work properly? You said that the Sample Query VI works, but do any of the other VI's work? You can probably use the sample query VI and modify the input to the query VI for your particular query. The wait function is probably to give the instrument time to respond. I think that this driver should do everything you need it to do.
I noticed that the VIs are calling dlls. One other option is that you could try registering the dlls that came with the driver and call them with ActiveX. This will give you access to available functions on the instrument.