I'm not very familiar with CODESYS and I'm just trying to update some current existing code that already exist. I have a flow meter input a current into the system with corresponds to a flow rate (gpm) and I would like to change this value into just volume (gallon) however how do I know how often the sensor is passing the data into the PLC? Is there a way to set the input to every second or 1/4 of a second?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-08-05
Originally created by: scott_cunningham
You will need to examine the hardware implementation. Is the input on an EtherCAT bus system? Is the input on a device that is polled via a serial port? Is the input native to the PLC hardware running the code? All of these can have completely different answers. Even for input native to the PLC hardware (as in it is on board) - the time could be based on PLC scan time or be some strange variation due to filtering or task priority, etc.
Once you know how the hardware is connected, you'll have a chance to figure out what the update rate is. Check the task update rate. This will be the PLC "scan time" (assuming your code will be in this task). Then you have to add in the topology update rate - as in how often will the PLC var be updated due to the serial link, or EtherCAT bus, or... xxxx. Don't forget to decide if you have variation (jitter) in the update rate!!!
Alternative: good old Lab test: If the input is analog, hook up a signal generator and measure your variable's change rate using timers or the trace function. Then you can compare what the signal should look like and what your variable shows.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not very familiar with CODESYS and I'm just trying to update some current existing code that already exist. I have a flow meter input a current into the system with corresponds to a flow rate (gpm) and I would like to change this value into just volume (gallon) however how do I know how often the sensor is passing the data into the PLC? Is there a way to set the input to every second or 1/4 of a second?
Thanks.
Originally created by: scott_cunningham
You will need to examine the hardware implementation. Is the input on an EtherCAT bus system? Is the input on a device that is polled via a serial port? Is the input native to the PLC hardware running the code? All of these can have completely different answers. Even for input native to the PLC hardware (as in it is on board) - the time could be based on PLC scan time or be some strange variation due to filtering or task priority, etc.
Once you know how the hardware is connected, you'll have a chance to figure out what the update rate is. Check the task update rate. This will be the PLC "scan time" (assuming your code will be in this task). Then you have to add in the topology update rate - as in how often will the PLC var be updated due to the serial link, or EtherCAT bus, or... xxxx. Don't forget to decide if you have variation (jitter) in the update rate!!!
Alternative: good old Lab test: If the input is analog, hook up a signal generator and measure your variable's change rate using timers or the trace function. Then you can compare what the signal should look like and what your variable shows.