05-31-2024 02:09 AM
Hello,
I have been using Hyperterminal to control my laser, which has been working just fine. I have just recently switched to labview, but I am unable to get it to respond to my commands. I did not have previous experience with Labveiw before this. I have read other forums on this, and it could be an issue related to the terminal commands.
Other than that, I have used the same settings as I have for Hyperterminal (please see below):
In Hyperterminal, I did not have to set any setting for red highlighted parts.
I have a strong feeling it is the termination character, but I have done several trial and erros but cannot figure out how to solve it.
On the manual of the laser control, it says that the termination character should be \r\n (which I have tried also). As you can see in the block diagram below, I have used GI\n (but I have also tried \r\n). This should give me the current set.
However, this returns E5 on the front panel, which is an error according to the laser manual, which means 'Illegal character'.
Here is the error in underneath 'Response' shown below on the Front panel.
I realise this is a very specific issue to my situation, but I'm just hoping someone who has encountered a similar problem can help me out.
Any help will be much appreciated.
Best regards,
Ash
Solved! Go to Solution.
05-31-2024 02:15 AM - edited 05-31-2024 02:17 AM
Hi anshul,
make the "display mode" indicator visible for all your string constants, controls and indicators.
Then switch to "\-code" display mode.
Now you can type the correct TermChars ("\n" etc.)!
Or use ConcatString with your command string as first input and the NL/CR string constants as next input(s)…
05-31-2024 02:23 AM
Do you expect responses from the laser? Sometimes responses from an instrument designed to communicate over a terminal program can be tricky to handle.
05-31-2024 08:43 AM
The simplest (and fastest, usually) way to diagnose Communications problems is to use MAX. Plug in your device, open MAX, find your Device (maybe it is COM3?), and open a Test Panel.
[Oops -- it appears that the VISA Test Panel might have been removed by NI. I found a recent "similar request" that might be helpful -- VISA command works in MAX, but not in LabVIEW . If you can get the Test Panel to work, this will give you a quick way to test sending your device a Command Sequence and seeing what it spits back at you (hopefully an understandable string of characters).
You'll also want to learn the "correct" way to handle serial devices (using VISA) with LabVIEW. I'll try to find the "Definitive Post" by @crossrulz and attach it here.
The basic idea (which works for most types of serial communication) is to do the following:
Here is the VISA Tutorial I mentioned: Proper Way to Communicate over Serial.
Bob Schor
06-01-2024 08:23 AM
Also, an event structure (typically) belongs in a toplevel loop. In your case, if you would change any controls while the VI is already stalled at the event structure, the new values won't be seen.
06-04-2024 03:14 PM
Hello everyone, many thanks for all the replies on this thread. I appreciate this very much.
The LabVIEW model is now working.
Making the display mode visible and switching to \-code worked.
Now, I can execute commands to the laser, and it works just as well as it was with HyperTerminal.
There is still a lot to learn to tidy things up, and I am sure the model can be optimised further. I will get to that soon. For the time being, I am just happy that the model is working.
On another note, the YouTube video recommended was also very helpful. So thanks for that 🙂