02-15-2013 05:13 AM
Hello Guys!
I'm trying to control my Hameg 4040 Power Supply via SCPI over VISA (RS232).
Writing works fine, but Reading back values won't work.
Tried to do a simple Test.vi which should just set voltage and current.
after this i want to read back my actual voltage.
I took the example SCPI codes from the manual, so should work (i think...)
Here is my VI and FGV
Maybe someone could figure out my problem?!
br
Sagi
Solved! Go to Solution.
02-15-2013 06:10 AM - edited 02-15-2013 06:17 AM
Found the Problem, but cant really understand why it behaves like that...
The while loop runs always three times... with two iterations no value have been read by then...
02-15-2013 07:25 AM
Next "funny" thing is that if I use the provided Express VIs reading is quiet fast, but for now i can't see dthe difference to my code...
02-18-2013 04:25 AM
Hello Sagme_Mi,
I assume you are reading too fast, after sending the command. I attached a VI, which shows how I approach an Write-Read Operation. I also attached a snapshot of the block diagram for the case you're using an older version of LabVIEW.
If the builder of the express VI hasn't this option, here is how you can see the code inside an express VI.
Right click on the express VI>>open front panel>>click "Yes" on the dialog
kind regards
02-18-2013 08:27 AM
sorry,
If the builder of the express VI hasn't blocked this option...
02-18-2013 01:31 PM
@HeinzGebel wrote:
Hello Sagme_Mi,
I assume you are reading too fast, after sending the command. with this encluded
Heinz, You can safely execute the loop 0 times if you put the VISA Resource on a shift register
02-19-2013 01:48 AM
Hi Jeff,
I tried and it works. Thanks a lot for your advice.
Kind regards
Heinz
02-19-2013 02:56 AM - edited 02-19-2013 03:10 AM
Hi!
I tried to open the Front Panel of the Express VIs, it's blocked 😕
So it is not possible to have a look behind the scenes...
I also tried your solution(s) I have the same problems as before.
Do I miss an important VISA setting, which the express VIs might set?
For now I use only:
-BaudRate(9600), I also tried faster rates but everything above 19200 doesnt work for writing either
-Timeout (2000)
-Parity None (as selected on the PS)
-Stop Bits 1 (also, as selected on the PS)
I also have found a problem in writing mode...
I cant set all four channels to a specified value:
What i dont understand is, after running trough this section, the PS have selected OUT1 with the right value but not one of the other channels.
!!!Also if i change the order of my string array...!!!
br
Sagme_Mi
02-19-2013 03:39 AM
Hi Sagme_Mi,
I have some more questions for you:
1. What "timeout in ms" did you set in my vi?
2. How many bytes are you expecting and how many do you get? Do you get any at all?
3. Maybe the hameg is waiting fo an termination character like 0x0A. Do you send one?
First of all I would try to establish the communication with an Hyperterminal like HTerm.
There are also several free tools to monitor the communication over your COM-Port. With such a tool you could observe what the expressVI is doing differently than your VI.
Kind regards
heinz
02-19-2013 04:13 AM - edited 02-19-2013 04:13 AM
If you want to see what the Express vi's are doing Hyperterminal won't help. Unless you have two spare com ports and a "Sniffer" program VISA should lock access to the port and prevent hyperterminal from accessing the stream. NI SPY will help here (Heinz, are you NI employee or are you just "accidentally blue"?)
Sagme, Can you link to the users manual for the device? It is likely that the express vi drivers did not account for some features of the device.