06-01-2017 04:49 PM
Hi guys, I need to read data from a lock-in. My VI works fine, but I've just realized that I need to retrieve not only magnitude, but also phase of the signal. I have to idea how to make it and be sure that they are retrieved at perfectly the same time? If you take a look at the picture attached, you can find command "mag" that is sent to the lock-in (and afterwards I save it in a text file). How should I send "pha" for reading phase? I'm afraid that inserting it in series will result in reading the phase of a signal some miliseconds after reading the magnitude. I hope I made it clear and you get what I mean Smiley Happy
06-01-2017 05:31 PM
Unfortunately this is likely a limitation of the device. Unless there are multiple ports there is no way to send simultaneous commands to the device.
What device are you communicating with? There may be a built-in command to help with this.
06-01-2017 06:01 PM
It's Signal Recovery 7265.
I can't believe it's true, it would be a disaster! 😞
06-01-2017 06:30 PM
I see the device's VI accepts strings as inputs. Is there a wa of sending "MAG" and "PHA" in a single string?
06-01-2017 07:12 PM
If the device supports a termination character (0x0A, 0x0D) then it may be possible to send the two commands at once simply by concatenating the two commands together, although this is unlikely to work if the device is not designed to handle it.
What is the difference if you run the program with two phase requests right after each other? It may be possible to just run them consecutively.
06-01-2017 07:56 PM
I see.
I try to obtain a frequency response, so I change the frequencies that are sent to the lock-in and to the device under investigation. I need to get an amplitude and phase at the very same moment, so I am afraid that if I send request for magnitude, then wait until lock-in sends it back, and then send request for phase, then the resulting phase would be a value for some other frequency.
06-01-2017 09:51 PM
Although I'm not familiar with Lock-In amplifiers, so I can't comment on how this is carried out, there is a section in the manual on compound commands:
6.3.12 Compound Commands
A compound command consists of two or more simple commands separated by semicolons (ASCII 59) and terminated by a single command terminator. If any of the responses involve data transmissions, each one is followed by an output terminator.
This at least answers part of your question, I think.
06-02-2017 06:31 AM
Thanks! I've found a compaund command MP - which is supposed to send magnitude and phase to the output, but I don't know how to retrieve the phase - I think I need to somehow determine where the output terminator occurs in output string. Is there any function that can help? I've found Scan From String, but I really don't know how to use it 😕
06-03-2017 03:53 AM - edited 06-03-2017 03:57 AM
I think what you're looking for is this command:
DD [n] Define delimiter control The value of n, which can be set to 13 or from 32 to 125, determines the ASCII value of the character sent by the lock-in amplifier to separate two numeric values in a twovalue response, such as that generated by the MP (magnitude and phase) command.
Here, you can set the value of the ascii character which is used to separate the two. Its use is described in the beginning of Chapter 6.
To process it in LabVIEW, you can split the response at that character, so long as the character is not the same as the termination character, or you can separately process two responses, if it is the same as your termination character. Your termination character should be set by your initialisation process, probably at a VISA Configure Serial Port node. The default used by that node is 0xA (13), or LF.
In this case, the results would be processed by VISA Read as two separate consecutive reads. If you use DD to set a different value (assuming that 13 is the default - it looks like it is but I haven't read through all of the manual or even all of the chapter) then you can use Search/Split String, in the Additional String Functions palette.
Using the VI which you posted the help window for in a previous post might just return the values in Response 1 and Response 2. If those VIs are working for you, then great, but I know nothing about them and I can't look inside them, so you'd need to post more information if you want specific help using those functions.