0-65535 value reading be word in S7-300

tulip

Member
Join Date
Oct 2005
Location
ist
Posts
236
How can I reading 0-65535 value reading from PIW258 address? I want to reading position parameter from Control Techniques Unidrive M600-M800 inverter (#3.29 P1 position parameter.).This parameter is 16 bits and the read value 0-65535.Thanks in advance.
 
How can I reading 0-65535 value reading from PIW258 address? I want to reading position parameter from Control Techniques Unidrive M600-M800 inverter (#3.29 P1 position parameter.).This parameter is 16 bits and the read value 0-65535.Thanks in advance.


When you use STL for example as program language

L PIW 258
ITD
DTR
L 65535.0
/R
L 100.0
*R
T MD 100

Now MD 100 has a value between O.O. and 100.0
Instead of MD 100 you could also use DBxx.DBDyy. Where xx is the datablock number and yy is the adress number in that db.

Kind regards
Henny
 
The position value starts at 0, and the value is an usigned INT. Is that correct ?


If you use ITD as Henny suggest, then the 1st bit will be interpreted as the sign bit and be set as the sign in the DINT address. The result will be a REAL between -50.0 and +50.0, not from 0.0 to 100.0

If that is not what you want, just copy the WORD to a DINT (without ITD).

You then have a DINT from L#0 to L#65535, and you can then convert to a REAL ingineering value if that suits you.
 
Hello Jesper

I forgot about the signet bit so you right.

Could even make the code nicer and set the corresponding min and max Value

L 0.0 // scaled value when PIW = O
T tmpMinsetting // tmpMinsetting = local temp variabele datatype real

L 100.0 // scaled value When PIW = 65535
T tmpMaxsetting// tmpMaxsetting = local temp variabele datatype real


L PIW 258
T tmppiwdint // tmppiwdint = local temp variabele datatype = Dint
DTR
L 65535.0
/ R
T tmpfactor // tmpfactor = local tmp variabele datatype = Real

L tmpMaxsetting
L tmpMinsetting
- R
L tmpfactor
*R
L tmpMinsetting
+R
T MD100 // assuming the result would be stored into MD100

Kind regards
Henny
 
This solution is valid only in a single motor application, but not enough when the gear box is put together. Because the gear ratio of 0-65535 is reflected on the motor shaft. It can be solved by using the encoder, but the customer wants me to use the 0-65535 value via the inverter. I have a suggestion for this. .Thanks in advance.İnverter is Control Tech.Gear ratio is 1/15.
 

Similar Topics

Hi Guys I wrote a programme which compares values in a counter to a pre set value depending on a number of calculations. I am using a Keyence...
Replies
1
Views
1,674
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
257
I want to set user security level based on the value of a tag in my PLC called "ActiveUser". That tag will contain the A-P code which we use for...
Replies
6
Views
214
hello. In Intouch, I want the color of the alarm window in the header menu to change depending on the priority value of the tag. To do this, I...
Replies
0
Views
82
I have a Type C to RS485 adapter connect to my Siemens RWF55. I use modscan to scan it to get a value from the Siemens controller. In the...
Replies
4
Views
102
Back
Top Bottom