From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Holmarc Monochromator troubling in setting a wavelength

Hi, I am trying to set a wavelength in a Holmarc Monochromator. I am attaching the LabVIEW code as well as the manual of it. In the code, the output is coming as 'Number of bytes requested was returned but there could be more data'. And the wavelength is not getting set ever. (I have opened the monochromator slit a little but no light is coming out of it, I have turned on the input lamp though..) What I am guessing is I am putting the wrong byte count in GPIB read (as is shown in the code, it is 1), but have no idea what to put else. Can anybody tell me where I am making a mistake in the code?

Thanks in advance..

0 Kudos
Message 1 of 2
(2,646 Views)

A couple things I see wrong.

1.  There is no reason to put the VISA configure inside the loop.  It belongs before the While Loop. You don't need to configure it every iteration of the loop.

2.  I have never found a need for VISA Clear.

3.  The while loop around 1 byte VISA Read is pointless because the Continue condition is  0=1 ?  Zero never equals one so the loop never iterates and there is no point to it.

4.  I see an issue with your Build Array to the upper left.  I see coercion dots.  All those values aren't the same datatype.  It seems like it is becoming an Array of U16's (since the U16's or I16's since the I32 is getting split in two words (16 bits).  The I8 is getting coerced to 16 bits, and the 3 constants, whatever they are, are also getting coerced.  So you may be generating more bytes in your message than the protocol wants you to have.

 

Read the communication manual again and make sure you are building the messages the way it wants them.  Put some indicators in there such as a string in Hex display mode so you can see what is being sent. 

0 Kudos
Message 2 of 2
(2,450 Views)