Ken Roach
Lifetime Supporting Member + Moderator
This is a sort of beginner question, but I'd appreciate some input.
I'm a longtime Rockwell user, and one of the convenient things about the A-B instruction set is that many of the instructions automatically convert datatypes.
You have to be careful about rounding, and wary of precision, but for simple math it's convenient.
I'm working in CoDeSys v3.5 (Bosch-Rexroth IndraWorks, specifically) and am wondering if there's a simpler way to do what I want.
All I'm doing is multiplying a REAL value between 0.0 and 10.0 so that the output is an integer between 0 and 30,000 (the command for an analog output module).
I think I have to perform a REAL_to_INT, and then use an intermediate INT type tag to get the data into my MUL instruction.
Is there a way I'm not aware of to tie the output of the REAL_to_INT to the argument of the MUL instruction without the intermediate tag ?
I'm a longtime Rockwell user, and one of the convenient things about the A-B instruction set is that many of the instructions automatically convert datatypes.
You have to be careful about rounding, and wary of precision, but for simple math it's convenient.
I'm working in CoDeSys v3.5 (Bosch-Rexroth IndraWorks, specifically) and am wondering if there's a simpler way to do what I want.
All I'm doing is multiplying a REAL value between 0.0 and 10.0 so that the output is an integer between 0 and 30,000 (the command for an analog output module).
I think I have to perform a REAL_to_INT, and then use an intermediate INT type tag to get the data into my MUL instruction.
Is there a way I'm not aware of to tie the output of the REAL_to_INT to the argument of the MUL instruction without the intermediate tag ?