Jump to content

samJones

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

samJones's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hi all, A very general enquiry: I'm interested in using a Unistream PLC (I have a US5-B10-T24 available) as a backup to log data from a SDI-12 sensor network (in this case soil moisture sensors buried somewhere deep in the Amazon ). I guess the most direct solution should be to use a RS232/USB to SDI-12 converter and then handle the requests and responses with message composer. If anyone has any experience or thoughts to share as to whether this will work or recommendations for compatible converters, they would be most welcome and appreciated! Thanks & all the best, Sam
  2. Hi, I am trying to read and log the output of the third party device (in this case a LGR trace gas analyser connected to a value manifold also controlled by the PLC) using a US5-B10-T24 PLC. The device returns 31 columns of data as a 521 character hexademical message. Of this I need to record at least columns 1, 2, 4, 6 and 8. The first column is a timestamp formatted as "dd/mm/yy hh:mm:ss.sss" and the subsequent columns are data values in scientific notation in the format "x.xxxxxe+/-xx" e.g. 1.56789e-01. I am able to use message composer and parse message to store this information as integers. For example for each of the data columns I populate data tags for the integer value (i.e. 6 digit integer, int32), decimal position (one digit, unit8) and the value of the exponent (sign and one digit, int8). I can then reconvert this information into real numbers. During testing this works fine for a message containing up to 5 columns of data, however, when I add a 6th column I encounter a strange problem where by the decimal position data tag for the 1st column appears to inherit the value of the integer data tag for the 6th column. Addition of a 7th column then extends this problem to the 2nd column and so forth. I'm either unable to see a silly (and repeated) mistake in my program or I guess I'm reaching some limit in the PLC's memory. I don't have a good grasp on the processing structure for this device (a hazard of GUIs maybe), so I'm hoping someone here might be able to help me identify the cause of my problem. I have attached here two programs (split between this and the subsequent post due to size limit), one (lgrC2-C6red) for 5 columns of data and one (lgrC2-C7red) for 6 columns of data. Examples of my problem are as follows: Examples lgrC2-lgrC6red program 5 columns (C2 - C6) with each linked in message composer to an integer (lgrC2-6_int), decimal position (lgrC2-6_dec) and exponent (lgrC2-6_exp) data tag works fine. When receiving the message; C2 = 2.2e2, C3 = 3.3e3, C4 = 4.4e4, C5 = 5.5e5, C6 = 6.6e6, the PLC displays lgrC2-6_dec = 1, lgrC2-6_int = 22 to 66 and lgrC2-6_exp = 2 to 6. 5 column hexadecimal message with control characters 20 20 20 20 32 2E 32 65 32 2C 20 20 20 20 33 2E 33 65 33 2C 20 20 20 20 34 2E 34 65 34 2C 20 20 20 20 35 2E 35 65 35 2C 20 20 20 20 36 2E 36 65 36 0A lgrC2-C6red program 6 columns (C2 - C7) each linked to an integer (lgrC2-7_int), decimal position (lgrC2-7_dec) and exponent (lgrC2-7_exp) data tag does not work. When receiving the message; C2 = 2.2e2, C3 = 3.3e3, C4 = 4.4e4, C5 = 5.5e5, C6 = 6.6e6, C7 = 7.7e7, the PLC displays lgrC2_dec = 77, lgrC3-C7_dec = 1, lgrC2-7_int = 22 to 77 and lgrC2-6_exp = 2 to 7. 6 column hexadecimal message with control characters 20 20 20 20 32 2E 32 65 32 2C 20 20 20 20 33 2E 33 65 33 2C 20 20 20 20 34 2E 34 65 34 2C 20 20 20 20 35 2E 35 65 35 2C 20 20 20 20 36 2E 36 65 36 2C 20 20 20 20 37 2E 37 65 37 0A Thanks in advance for any input or suggestions, Sam lgrC2-lgrC7red.ulpr
  3. Hey Joe, Thank you very much for taking a look at this for me. When I run your alterations I receive the error "Feature: message composer; File: message composer; Line: testDevice-testMessage; Description: Error, a scanned message cannot contain real types ". However your edits have inspired me to find a solution (albeit not a very pretty one!) to my problem. Essentially I have added 65h (e) as a control character to the message in order to parse the number and exponent (because the instrument outputs in scientific notation) as integers, e.g. <data1><65><exp1><20><data2><65><exp2><20><data3><65><exp3><20><data4><65><exp4><20><data5><65><exp5><20><data6><65><exp6><20><OD><OA> , and then recombined the integer (T_whole), fractional (T_frac), decimal (dec) and exponent (e) parts for each to achieve the desired real number data tag (T_complete) to log e.g. This seems to do the trick. I've attached the code here in case it might be of use to another lost soul in the future or someone can suggest a more efficient solution! Cheers, Sam 1865654005_incubationSystemV4forumJTSJ.ulpr
  4. incubationSystemV4forum.ulpr Hi Joe, Yes, indeed it is. The message is broadly along the lines of <data><20><data><20><data><20><data><20><data><20><data><20><OD><OA> However I suspect I'm not specifying the elements correctly. Please find the code attached. Any suggestions to get me back on the right track would be greatly appreciated! Cheers, Sam incubationSystemV4forum.ulpr
  5. Hi, This is -hopefully- a relatively simple question, but I'm a bit out of my depth so apologies if I manage to confuse the situation with imprecise terminology! I need to read (and ultimately log) the serial output of a third party device to a Unistream PLC. The device outputs six values (e.g. 5.10945e1 1.00361e2 -2.58244e2 -1.2803876e-1 8.77776e1 2.5464391e-1) as string (hexidecimal, length 70) that ends with a return (OD) and new line character (OA) e.g. I can read this string into a buffer tag using the Com Rx function and I can see in online mode that the data arrived bit tag is updating at the correct rate and that the hexidecimal values received by the buffer tag seem to respond sensibly. However, I'm stuck trying to understand how to go about defining the contents of the buffer tag as a message in Message Composer so that it is recognised by the Parse Message function. I would greatly appreciate any suggestions about how to do this or resources that might help me better understand my problem! I have found useful information here and in the video tutorials but I'm obviously still lacking some critical piece of knowledge! Ultimately I would like to end up with 6 data tags containing ASCII values that I can append to a .csv file created elsewhere in the program, but I'm not at this moment clear on the steps in between. Hopefully the above makes sense, if not I'll try again! Many thanks in advance, Sam
×
×
  • Create New...