05-06-2016 08:21 AM
Hey Guys,
I'm trying to setting up a serial communication between my PC and a Mettler Toledo micro balance (XS-205). The Balance is connected via a RS 232 cable to a TU-S9 USB adapter and then to the PC. I do see the port in the NI MAX and via the test panel I've set the configuration of the communication according to the ones of my balance:
BD rate: 9600
Bit\Parity: 8/none
StopBits: 1
Handshake: none
EndofLine: LF
CharSet: Ansi\Win (only in the setting of the balance)
Continous mode: OFF ( " );
now the point is that if I try to query the command *IDN?\n I get as answer
1: Write Operation (*IDN?\n)
Return Count: 6 bytes
2: Read Operation
Return Count: 17 bytes
S\sS\s\s\s-0.0006\s\sg\n
with an error in the return data (Hex 0xBFFF006C). I've also tried to use the script provided by the NI website for Mettler-Toledo balances but I don't get any data and at the end of the routine I get the error VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
Anyone as a clue of what's going on? Thanx a lot for the help 😄
Cheers!
Solved! Go to Solution.
05-06-2016 09:39 AM
Hello,
The command from MAX seems correct, every time you send this command, it automatically asks for a reply from the instrument.
In your case, you are receiving -0.0006g.
About the error code, check this link.
05-06-2016 10:04 AM
Actually, the 17 characters you received were "S S -0.0006 g" + an End-of-Line character. The "S S " is "Mettler-speak" for a stable balance reading.
The Balance appears to be running in its "reporting" mode, sending you readings. You tried to give it a command, and it didn't respond. It's been a while since I wrestled with these devices, but I have a colleague who still is using them -- I do seem to remember that getting them initialized properly was a bit of a trick ...
It would be very helpful if you post the code (not a picture, but the VI or a LabVIEW Snippet of it) so we can compare it to code we might be using (or spot the input parameter you forgot to specify).
Bob Schor
05-09-2016 04:49 AM - edited 05-09-2016 05:01 AM
Thanks guys for the prompt answers.
my mistake. Mettler Toledo Balances do not accept the standard SCPI commands but they have their own standardized command set.
Thanks anyway 😉
11-13-2024 02:46 AM
i still stuck on the code
please help.
the codes are
--------------------
serialPortObj.ReadTimeout =7000;
...
serialPortObj.Write("*IDN?\n");
res = serialPortObj.ReadExisting();
-------------------
res is empty,
please.
11-13-2024 06:47 AM - edited 11-13-2024 06:48 AM
1) This is not a LabVIEW question so don't post in this forum
2) The post before yours indicates that Mettler Toledo balances have their own specific commands and don't work with SCPI commands. Therefore consult your Programming Reference Manual for your device and use the commands documented in there.
3) Appending a "me too" post to a thread that is 8 years old and marked resolved is pretty useless.
4) This looks like one of those nonsense posts where someone copies something looking like a legitimate post from some place like Reddit or Stack Overflow just to post something. Why?