
Richlinares (Customer) asked a question.
Hello Looking for some thoughts on a project. I am trying to read a defender 3000 scale gross/net/tare data via RS232 into a productivity 1000 plc with the hopes of moving project to a 2000 plc.
the scale data is 18 characters long with two term characters 0d/0a.
I am most positive that the scale is sending out Gross, Net, and Tare weights as consecutive strings with the term characters between each. the scale is set to output data at 1(have also tried 3 and 5) second intervals
i had my scale set to continuous print and was able to use an ASCII IN to receive a good string with the scale gross weight. but that is all that I would get no NET or Tare weight data. I set my scale to interval and in the first shot my incoming ascii string would correctly show the gross, net, and tare weights in a repeating cycle very consistently one after the other.
this led me to make some logic to extract the 16th character from the incoming string which is either G, N, or T then do some string comparisons to store the first 11 characters of the string which is the actual weight data depending on what character is being read with one-shots and was able to store gross, net, and tare weights as individual strings.
then the way the data was coming in changed for some reason. now instead of the steady repeating cycle i saw at the beginning the incoming string is more static only showing mostly the gross weight and every now and again i see the NET and T characters show up but its totally random.
my problem is that my logic to read the weights works but somethings not right.
I put a 5lb weight on the scale, gross string: 5.00lb, Net String: 0.00lb, Tare String: 0.00lb
I press the tare button on the scale, gross 5.00lb, Net 0.00lb, Tare 5.00lb
I add 1lb to the scale, gross: 6.00lb, Net 1.00lb, Tare 5.00lb
So up to this point even though I do not see the incoming data fluctuating I think the PLC is reading the data correctly because its putting the right values into my strings using the comparison of the 16th character.
where things go wrong is when i try to clear the tare data at the scale head my string data gets messed up.
I press tare button on scale again, gross 6.00 lb Net 0.00 lb, Tare 6.00lb
I remove all weight from scale: gross 0.00 lb, Net -6.00lb, Tare 6.00lb
I press Tare on the scale, gross 0.00lb, Net 0.00 lb, Tare remains at 6.00lb
there is my problem, by logic the tare data should revert back to 0.00 lb as that is what is on the actual scale. I am assuming this would work just as if i was applying weight and implementing the tare. I tried some rising and falling one shots on the lines that store the weight data not sure what i was thinking or why I thought that would work but it did but only for a while then it went back to the same error so I'm thinking it was more of a timing issue and not anything I did with the logic.
sorry for the paragraphs but just trying to put as much info out there to see if anybody has run into anything similar or has been able to read gross,net,tare weights from an ohaus defender 3000. maybe its a timing issue that I am not seeing. I can upload my program if needed
Thank you in advance
Ric L.
Are you using the variable length option in the ASCII In instruction?
Hello,
I tried using fixed length with number of characters set to values 20-50 and i would only see the first 18 characters. i tried this option today and set the character count to 73 and i can see the entire string. i can't tell what was done differently to get a positive result. i noticed that i have to put a small value into the inter character timeout or else the text will scroll within the string i have 10ms. the only thing with this method is that I don't get data until i place a weight on the scale and press tare. then i get live gross/net/tare values. If i tare the scale with no weight on it the data string freezes retaining its current values until its tared while it has weight on it, taring with no load does not resume the live data. I am trying to display the live values on a screen and also send to a label printer so having one value on the terminal and a different value on the screen would cause confusion. If the values would update consistently then this would be the ideal solution.
With the instruction set to variable length max number of characters set to 19(also works with 73) and two term characters 0D/0A inter time out 10ms, the characters read max out at 18 i think since there are CR LF characters after each weight data 0.00G CR LF 0.00NET CR LF 0.00T CR LF. So i don't think i can read all 73 characters with the variable length since the terminating characters at end of the string are also used as separations within it. with this method i do the extraction and comparisons mentioned prior and get live data from the start with no need to press anything on the scale. when i remove weight and tare the scale, both the gross and NET update as they should but the tare does not. i found a work around by moving 0.00lb via oneshot into the tareweight string when both gross and net equal 0.00lb.
this appears to be working as i need it too, im just concerned that i am doing a bunch of unnecessary stuff since there is a way to read the entire string in one shot. I also worried about all the randomness that i encountered to get up to this point as this is a project for a potential customer and need the results to be consistent 24/7
The ASCII In instruction is always enabled there are no conditions in the rung. could this be an issue? the printer is set to print at 1 second intervals
Thank you,
Ric L
Also, I have a total of 5 scales that i need to do this with. I originally planned on using a P1000 for each scale but my customer wants only 1 PLC so I want to move this project to a P2000 so I can install a RS232 comms module and bring all scale data into 1 main controller. I am hoping that this is possible and don't run into any issues there thinking that each channel is independent from the rest and the data won't interfere
There are a few things in this video that could help. It is important to toggle the enable on ASCII In.
https://youtu.be/LmqGjK-MAr4