Hi,
I'm looking to add more system variables outside of the standard Automatic External I/O. ie. $CURR_ACT,
Would it be best to do this through config.dat and map accordinly?
KR C4 controller and EL6695.
Thanks
Hi,
I'm looking to add more system variables outside of the standard Automatic External I/O. ie. $CURR_ACT,
Would it be best to do this through config.dat and map accordinly?
KR C4 controller and EL6695.
Thanks
To transmit a system variable that is not also a Signal, you would need to execute code to transcribe the variable. To do this "realtime," regardless of what your foreground task is doing, you probably need to put this code into the SPS.
So, in CONFIG.DAT, you might create:
SIGNAL CURR_ACT_OUT $OUT[1] TO $OUT[32]
This creates a 32-bit, signed-integer output.
Then, in the SPS User Loop section:
CURR_ACT_OUT = $CURR_ACT.
This, of course, would need to be customized to your specific application. For one thing, a 32-bit output is probably overkill for a lot of variables.
Would it be best to do this through config.dat and map accordinly?
as mentioned, you need code to transfer values.
one can declare variables in $config.dat but i would not consider that the best.
i prefer keeping all of my code and declarations in my own files. if something is to be executed in SPS, i put the code in my file and call it from SPS.
Display MoreTo transmit a system variable that is not also a Signal, you would need to execute code to transcribe the variable. To do this "realtime," regardless of what your foreground task is doing, you probably need to put this code into the SPS.
So, in CONFIG.DAT, you might create:
SIGNAL CURR_ACT_OUT $OUT[1] TO $OUT[32]
This creates a 32-bit, signed-integer output.
Then, in the SPS User Loop section:
CURR_ACT_OUT = $CURR_ACT.
This, of course, would need to be customized to your specific application. For one thing, a 32-bit output is probably overkill for a lot of variables.
as mentioned, you need code to transfer values.
one can declare variables in $config.dat but i would not consider that the best.
i prefer keeping all of my code and declarations in my own files. if something is to be executed in SPS, i put the code in my file and call it from SPS.
Thanks both for your help, worked a charm. I used SkyeFire's method for testing, however I like the idea of having a seperate file and call it from SPS.
You need to be a member in order to leave a comment