11/20/2012 12:30 PM | |
Posts: 20 Rating: (0) |
Hi folks, Im using a profinet IO link device with a 315, All set up and working etc. My device plugged into the IO link sends 2 bytes of info (0-10v input). Im reading the 2 bytes and I believe the input is split across the 2 bytes. How to I convert them 2 bytes (100, 101)into a usable format (int or real) Many Thanks Edited, here is the data sheet and how the signal is split across the bytes.. http://www.balluff.com/media/877979_1104_EN.pdf |
Last edited by: craiglb at: 11/20/2012 12:37 PM |
|
11/20/2012 1:19 PM | |
Joined: 1/3/2006 Last visit: 2/19/2024 Posts: 726 Rating: (71) |
Hi Craiglb As a first step just use FC105 (available in Step 7 Librabry) to scale the raw data into engineering value of your choice. You can see further details of FC105 overhere.
|
11/20/2012 7:18 PM | |
Joined: 9/27/2006 Last visit: 10/14/2024 Posts: 12287 Rating: (2685)
|
Hello craig, m.shoaib khatana; I must point out here that the output of the scaling function FC105 is already in REAL format: How and for which analog measurements can you use the function FC105 "SCALE" to convert the integer values (INT) into real number values? The Scale Values function FC 105 "SCALE" converts an integer value (IN) into a REAL value. This is scaled in physical units between a low and high limit value (LO_LIM and HI_LIM). The result is written to the OUT parameter. If the integer input value is not in the range specified for the type concerned (BIPOLAR or UNIPOLAR), then the output (OUT) is linked to the nearest value (LO_LIM or HI_LIM) and an error is issued. So the problem encountered cannot be resolved with m.shoaib's suggestion. I am not familiar with the treatment of analog values on IO Link, but it seems that the first 2LSBs of the transfered dataare used for error signaling and interfacing, so there is a possibility that they might have to be removed from the analog value before treatment. This would be done by a SBR (2) operation. Has anyone else worked with this iussue? Hope this helps, Daniel Chartier |
Last edited by: dchartier at: 11/20/2012 7:19 PM |
|
This contribution was helpful to4 thankful Users |
11/21/2012 3:03 AM | |
Joined: 10/7/2005 Last visit: 10/14/2024 Posts: 3024 Rating: (1054)
|
Hello craiglb haven't had a chance to use IO-Link yet either, but I agree with dchartieras theBallufdatasheet is pretty clear concerning the AI value format which is as followed. The14 bit resolution AI value is contained in Bits 2-15, bits 0&1 are used for status indication (and not applicable in your case asyou usea 0-10V transmitter). Let's assume you do a SRW 2 first to get of theunused status bits, you have the following: 0-10V equates to a digital value of 0-16384 (14 bit resolution). FC105 usage is as such out of the question here as it always internally assumes 27648 as the raw max value which is specific to Siemens AI cards. Apart fromwriting your own scaling block, you can though also use the ready made onesfrom How can you standardize and destandardize analog values with STEP 7?. Theseallow you to nomiate the "raw" AI value range (0-16384in your case afteryou did the SRW 2) as well as the scaledengineering unit range. I hope this helps |
Cheers |
|
This contribution was helpful to3 thankful Users |
11/21/2012 11:24 AM | |
Joined: 1/3/2006 Last visit: 2/19/2024 Posts: 726 Rating: (71) |
Hello Craigb, Based on above discussion, I have made a block which may solve your problem or it can give you a starting point to proceed ahead. Check it. Regards Manmeet
AttachmentScale.zip (162 Downloads) |
Last edited by: manmeet at: 11/21/2012 11:32 AMFritz I read your post after submitting mine. Craigb has already done it. What I have submitted may be just an alternative. |
|
This contribution was helpful to1 thankful Users |
11/28/2012 8:31 AM | |
Posts: 20 Rating: (0) |
Sorry this has taken so long to post folks. Heres the FC supplied by balluff to process the IO link value.
AttachmentIOlink.zip (222 Downloads) |
This contribution was helpful to4 thankful Users |
Follow us on