?
Solved

Serial port between my computer and Precisa scale

Posted on 2012-08-28
28
Medium Priority
?
916 Views
Last Modified: 2012-09-03
Hello everyone. I have a Precisa scale, which i connected to my computer through a serial port connection. The manual of the scale is here:

http://www.precisa.com/download/en_320XB_Handbook.pdf

The scale has a RJ45 output and the pins are given in the manual (picture1)pins of the output

My RJ45 cable is of the type T568A, so i connected some of the pins directly to a R232 db9 according to the manual (picture2)pin to R232
Now, when i open Visa test panel to test my device. My values of baud, handshake etc are given in picture3values
When i write any command, for example a command for remote control (picture4)command it gives an error, when i read my command. So the question is : what is wrong ?.. Im writing that command, which gives the scale a dark display "\D\r\n", and when i press "write" the command changes automatically to "\r\r\n", and it says error after the reading process. Whats the problem ?
0
Comment
Question by:Ossi89
  • 11
  • 8
  • 8
27 Comments
 
LVL 21

Expert Comment

by:viki2000
ID: 38344281
In the chapter 5.7 and 5.12 of the user manual are some settings for your Precisa scale.
Did you make the requested settings?

Parallel with Labview I would try a simple RS232 terminal commands, only to see if the cable is OK and if the scale responds. Just use a ready made software, application, Labview example able to send/receive commands over serial port in order to make sure the hardware connections are OK. That would be the first step. Then you can focus on your Labview debugging.
0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38345383
According to the manual (page 38), the scale is either 600 or 9600 baud; 7 bits, even parity, & 1 stop bit, with no flow control by default.  Change your setting to no flow control and, if it doesn't work at 9600 baud, try 600.
Often, too, when the device is not exerting RTS or CTS properly, you need to jumper pins 1- 4-6 and 7-8 on the 9 pin end which fools the serial port into handshaking with itself and you then only use wires for RX, TX, and ground to the device end.
I would:
1) remove the handshake wires and jumper 1-4-6 and 7-8
2) use Hyperterminal at both 9600 and 600 baud, issuing that D--------<enter> command to see the scale display change to -------
3) If still no joy, jumper 2-3 on the 9 pin (removing the wires to the scale) which makes a loopback and anything you type in Hyperterminal had better be echoed right back to the window or something is wrong with the com port.
Here is an article on loopbacks and testing: http://www.ni.com/white-paper/3450/en
0
 

Author Comment

by:Ossi89
ID: 38345488
Hi Davis

What do you mean with "jumper" ?

/Osman
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38345690
A short wire connecting the pins to each other.
0
 

Author Comment

by:Ossi89
ID: 38345753
But when i use the 232Analyzer as a testing software, it says CTS is Turned OFF, when i disconnet the RJ45 cable from the scale. When i connect it againt, it says CTS is Turned ON, so there must be a connection ?

I have uploaded a picture:
CTS
0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38345993
How about DCD (Data Carrier Detect) and DSR/DTR?  They must all be true for the com port to send data.
Read that article I posted before.
0
 

Author Comment

by:Ossi89
ID: 38348569
Sorry for my bad question, but as far as i understand, i have to make a wire, which connects pins 1-4-6 together, and i have to make another wire which connects pins 7 and 8 together. Tx, RX and Ground wires, goes directly to the device. I have uploaded a picture: Example
0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38351397
Yes; that's it!
0
 

Author Comment

by:Ossi89
ID: 38353623
When i press a button now, the scale sends data to the software, so there must now be connection, But when i'm writing the command to show the "-----" on the scale, the scale doesn't show that. Anything wrong with the procedure in the softsoftwareware ?
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38353648
Did you try other commands from user manual to see if the scale is responding?
0
 

Author Comment

by:Ossi89
ID: 38353707
Yes.. But it didn't respond :/.
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38353748
I noticed that if you send "Data sent: \D —\r\n " the the answer is " Data received: 032 032 032 032 032 032 032 032 032 QA8 046 048 048 032 103 013 010 "
And if you send "010 Data sent: 6," the the answer is the same " Data received: 032 032 032 032 032 032 032 032 032 QA8 046 048 048 032 103 013 010 "

That is important.

Could you try with other sets of commands to see if you receive the same answer?

Try for example "OFF" and "ON" functions to switch off and on the balance.
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38353760
Did you switch off "Precisa BUS" in chapter 5?
"To connect any Precisa BUS accessories switch the BUS to ON, else switch it OFF to have a normal RS232 communication."

In the RS232 analyzer software that you use, could you switch at RX the format in ASCII to see what you get as characters?


Then try by curiosity Hyper terminal connection from Windows to see what answer do you get.
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38353809
If I look at the ASCII table:
http://www.asciitable.com/
http://www.asciichart.com/

And I read the decimal response received in your RS232 software then is something like:
SPACE SPACE...9 times , then 0.0 SPACE g CR LF
That means a response, how else do you expect to obtain "g" for grams?
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38353819
What firmware do you have?
"for firmware Nxx factory setting is 600, for other firmware 9600"

Try also other parity:
PARITY 7-NO-2STOP
PARITY 8-NO-1STOP
by setting the scale and also the RS232 analyzer software.
0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38354034
Yes, I was going to suggest 9600 baud, too.
Is this a new scale or a used one?
If its new, the Precisa Buss is off and the only variable should be the baud rate.  If its used, you need to read chapters 4 and 5 in the manual so you can verify the scale's configuration.
0
 

Author Comment

by:Ossi89
ID: 38354148
Thanks for the answer. The Precisa bus setting is also confusing me. Because when i switch configuration settings in the menu of the scale, it skipping the "Precisa Bus settings" and goes directly from "Key tone" to "Language settings". I have written a mail to Precisa to days ago, but they didn't answer me.

When i press on the "Print" button on the scale, it sends all those numbers to the software, but when i write any command from the manual, there is no change on the display of the scale.

And yes. The scale has been used some years ago
0
 

Author Comment

by:Ossi89
ID: 38354266
DataThe first data line is, when there aren't something on the scale (0g).
When i place my iphone on the scale (135g) it gives the second line.
When i place my book (1800g) it gives the third line.

So there aren't something wrong with sending data from the scale to my computer, but the problem is those commands, which doesn't give any respond :(
0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38354935
Can I ask why you keep adding the \ to your commands?
D------- is what it says to send.
And, have you tried setting the Data Format (RX) to ASCII?
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38356721
In data format for Data Received (RX) could change to ASCII, so we see the characters and not decimal numbers?
0
 
LVL 44

Expert Comment

by:Davis McCarn
ID: 38357107
I just pulled up my antique ASCII chart and you are communicating properly.
The third line is <space><space><space>+<space><space>1830.65<space>g<cr><lf>
0
 
LVL 21

Expert Comment

by:viki2000
ID: 38357353
Exactly what I found in ID: 38353809 above.
0
 

Author Comment

by:Ossi89
ID: 38360587
Sorry for my late answer, but yes Davis. When i format the RX to ASCII i get:
RX (ASCII)
So it gives me the value of gram, the scale display shows (407,51).

Those commands still doesn't work, and i need it for my Labview projekt :(
0
 

Author Comment

by:Ossi89
ID: 38360590
And i get that data from my scale, when i press on the "print" button on the scale, it directly sends the data to my PC. But nothing happens, when i send any command from my PC
0
 
LVL 44

Accepted Solution

by:
Davis McCarn earned 2000 total points
ID: 38360731
From the manual (Page 56)
! NOTE: Each remote control-command must terminate with «CR» «LF»
They are buttons in your software; but, would have been sent by HyperTerminal automatically.
0
 

Author Comment

by:Ossi89
ID: 38360763
How do i find those button in HyperTerminal ?.. I have downloadet it now, and cant find those buttons
0
 

Author Comment

by:Ossi89
ID: 38360811
The problem is solved.. I didn't see thos buttons in RS232 analyzer.. Thanks for the help :)
0

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
Gift cards are not a new concept - it's been around for a very long time.  Undoubtedly, over the past you have received such a card or purchased one for a friend or relative.  Are you aware that you've been feeding the machine?  If not, read on :)
Articles on a wide range of technology and professional topics are available on Experts Exchange. These resources are written by members, for members, and can be written about any topic you feel passionate about. Learn how to best write an article t…
Saved searches can save you time by quickly referencing commonly searched terms on any topic. Whether you are looking for questions you can answer or hoping to learn about a specific issue, a saved search can help you get the most out of your time o…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question