PH from Brazil Posted February 25, 2011 Report Share Posted February 25, 2011 Dear, how are you? I have a problem and would appreciate any help. I use a serial port from Visio 230 to read data from a Vaisala WXT520 weather station. It´s all right but the rain message. I´ll explain. I receive repeatdly the rain message in the following format: 0R3,Rc=9.9M,Rd=8s,Ri=7.7M,Hc=6.6M,Hd=5s,Hi=4.4M,Rp=9.9M,Hp=2.2M<CR><LF> But dependent on the intensity of rain, the message changes its long and may be like this 0R3,Rc=19.9M,Rd=18s,Ri=27.7M,Hc=16.6M,Hd=25s,Hi=14.4M,Rp=91.9M,Hp=22.2M<CR><LF> In resume: only the dividers are constant, but the numbers are not. The message lenght changes because of numbers change. How can I use Protocol Scan to read this message "all the time", independent on values or string length? I tried to use 8 Variables at the configuration protocol to this message, but it not worked. Some doubts: - What configurations may I do on message properties? I tried to use Numeric, Decimal ASCII with no fixed length, with No Prefix. It should be working? - When I use only one variable to transfer all the message to, it worked, but it´s very difficult solve the values when the positions are not fixed. Quote Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted February 27, 2011 MVP 2014 Report Share Posted February 27, 2011 There are a few of options I have used. 1. Check the features of the Vaisala instrument - maybe you can change the numeric format to have "leading zeroes". That will make the numeric fields always have a constant length. 2. Determine the number of different possible messages based on the different length numeric variables that can be sent. If there are not "too many" different messages then create a protocol scan message for each different option. When the input message is received the PLC will match it to the scan message that fits. 3. If there are too many variations to use option 2, then the only other option is to use the "stream" variable type to catch the string as a stream and decode it using ladder programming. This is by far the more complex option, so I would look very closely at whether you can solve it with option 2 above. Quote Link to comment Share on other sites More sharing options...
Gabriel Franco Posted March 31, 2011 Report Share Posted March 31, 2011 So, just using protocol scan FB, It's not possible to get numeric data with different lengths even there's control char or any other characters as a separation between values ? I have a similar issue, 5 values to get, all numeric, all with different lengths, so, there's so many combinations. Decimal ASCII no fixed length confuses me. Quote Link to comment Share on other sites More sharing options...
Ag Automation Posted January 23, 2013 Report Share Posted January 23, 2013 I am using a V130 to control irrigation and control greenhouse climate. I would like to add weather sensors, wind speed, direction, rainfall amounts to the PLC so that i can automatically make adjustments based on outside weather. and suggestions where to find such sensors? It would not need to be highly accurate. Quote Link to comment Share on other sites More sharing options...
AlexUT Posted January 23, 2013 Report Share Posted January 23, 2013 Ag Automation, Please open a new topic. This will help to organize Q&As. Thanks. Quote Link to comment Share on other sites More sharing options...
MVP 2021 Joe Tauser Posted January 24, 2013 MVP 2021 Report Share Posted January 24, 2013 You're going to have to read the whole string and parse it in logic by searching for the commas and breaking it into pieces. Then you can use the ASCII->NUM functions to get your numbers out. I just went through this with a comma separated barcode that had variable fields like yours. It wasn't too bad once I figured out what I had to do. Post your code and maybe we can help. Joe T. Quote Link to comment Share on other sites More sharing options...
razor_rich Posted August 21, 2013 Report Share Posted August 21, 2013 Hi, I need some help with the Protocol Scan FB. I'm reading the following output from a scale, and I just need to get the weight (the XXXXX.XX part). Can anybody advise me on how to setup the "Protocol Message" in the Protocol Scan FB? Quote Link to comment Share on other sites More sharing options...
razor_rich Posted August 22, 2013 Report Share Posted August 22, 2013 Via Termite (http://www.compuphase.com/software_termite.htm), I'm getting the following string: [02] 402.2LG There is a space (aka "<SP>") on the end of that string for the "status" field. The weight is 402.2. I need to extract this weight from the string and store it with my V130. The "L" is for "pounds" and the "G" is for "gross." I'm assuming the "[02]" indicates the <STX> control character. Quote Link to comment Share on other sites More sharing options...
razor_rich Posted August 22, 2013 Report Share Posted August 22, 2013 I'm trying to figure this out on my own, but a key sentence in the Help manual is missworded. Can somebody please explain to me in plain English what the third green call-out box is trying to say? Quote Link to comment Share on other sites More sharing options...
Gabriel Franco Posted August 22, 2013 Report Share Posted August 22, 2013 Try this way. Set MI523 = 10 (1 decimal place) and use an ML instead MI to link your weigh value. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.