You can reference I/O signals in your expressions and use them in your calculations. You need to supply the full path of the signal, and possibly the parameter. For example, if you were referencing the input signal on the first channel, CH1, of the second card, C02, in a controller's subsystem, and the controller was CTRL3, the reference to that channel in your expression could look like this:
'//CTRL3/IO1/C02/CH1/FIELD_VAL_PCT
When you are reading data from a channel, you do not have to specify the parameter field. If you do not specify a field, the default (.CV) field is implied.
When you are writing data to a channel, you can reference specific parameters. If you do not specify a field, the default (.CV) field is implied.
You can read and write data to the I/O channels in your expressions to obtain the behavior you want. For example, suppose you wanted to convert an analog value to its corresponding temperature in Celsius. For this example, assume you have a temperature transmitter that sends an analog signal of 1 to 5 Volts. The voltage corresponds to a range of 0 to 200°C, and you want to convert the analog value to a temperature value so that you can display it for the operator. First, you need to know which channel the 1-to-5 volt signal is on. For this example, assume that it is the signal on the channel we used previously.
For the calculation, you would need to subtract 1.0 from the voltage because the temperature scale is zero-based. Then, you would need to multiply the value by 50 because 1.0 volt corresponds to 50 degrees in this example. The expression for the conversion might look like this:
CELSIUS := '//CTRL3/IO1/C02/CH1/FIELD_VAL_PCT' *(4.0/100.0)* 50;