sadyrbek Posted November 20, 2014 Share Posted November 20, 2014 Dear Support, I am using OPC between the PLC and Daq. I have an analog output to control the valve. This channel is a REAL Value in PLC. But I could not convert word to integer in my OPC. So, I think I need to convert it in Daq Scada. How can I convert the normal set to REAL Value? For Example: 20- 16xxx 30-16xxx Thanks in advance, Sadyr Link to comment Share on other sites More sharing options...
AzeoTech Posted November 20, 2014 Share Posted November 20, 2014 I'm not really sure what you are trying to do. OPC isn't a protocol like modbus where you can just translate in bytes from integers to floats. Also, DAQFactory should be able to set a real (i.e. float) value over OPC with no translation. Link to comment Share on other sites More sharing options...
sadyrbek Posted November 21, 2014 Author Share Posted November 21, 2014 Dear Guru, When there is a connection via OPC there is no many choices like to write float or real. When I write without OPC with DF Quickmod SCAN, it is ok. But, via the OPC, how can I convert my setpoint in DF, forexample 50 C to 16968? I have too many tags, so not to confuse I do not want to write with sequence. Is it possible to use some conversion on channel or before setting the channel? Thanks in advance. Link to comment Share on other sites More sharing options...
AzeoTech Posted November 24, 2014 Share Posted November 24, 2014 The OPC server should have an option to specify float or real. Anyhow, the Conversion you want is: (from.Float(Value))[0][3] * 256 + (from.Float(Value))[0][2] That will convert 50 to 16968, and other integers to part of the float. You can then apply that conversion to any channel. Note that this will only work on integers because you are ignoring the decimal part of the float and only updating 2 of the 4 bytes. Likewise, you will be limited by the range of values available. This may or may not be a problem. This is not the best solution really, but if it works for you, there it is. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.