Hi
How do i convert an integer to IEC time?
I am still doing my first Step 7 project.
I am trying to write a block to scale an integer (0 - 9999) from an HMI input into a timer preset for an IEC TON timer.
I have a multi instance FB of around 100 timers and am trying to use temp variables inside the FB for the calculation for the timer preset.
I realise the timer preset is milliseconds so am trying to multiply the 9999 by 1000 in DINT to get seconds.
If i use MD1 as the output of the Mult DI and the input of the SFB4 it works fine.
I wish to use a #temp variable instead and cannot make it work. If i select DINT the MULT works fine but the TON rejects it and vice versa for a time data type.
By the way i am using ladder not STL, i understand STL is not so fussy on type checking but my customer prefers ladder where possible
How do i convert an integer to IEC time?
I am still doing my first Step 7 project.
I am trying to write a block to scale an integer (0 - 9999) from an HMI input into a timer preset for an IEC TON timer.
I have a multi instance FB of around 100 timers and am trying to use temp variables inside the FB for the calculation for the timer preset.
I realise the timer preset is milliseconds so am trying to multiply the 9999 by 1000 in DINT to get seconds.
If i use MD1 as the output of the Mult DI and the input of the SFB4 it works fine.
I wish to use a #temp variable instead and cannot make it work. If i select DINT the MULT works fine but the TON rejects it and vice versa for a time data type.
By the way i am using ladder not STL, i understand STL is not so fussy on type checking but my customer prefers ladder where possible