Can you please tell me how to make the .dat file public as i need to make global variables?
example:
So will you please tell me, which part of executable code do i need to put in sps.sub? The full code .src of my pick and place program? or declaration from .dat? and between which lines in .sub should i keep my executable codes?
You can not put all your code in .src in sps.sub. Only the relevant "fragment" for sending the values to PLC in real time are necessary. Please note that sps.sub runs parallel with robot program and it is independent. You can make the conversion of real to integer in the sps.sub, for example
And i have made signal deceleration like u showed in .dat file of my own code not in $config.dat, is it ok? or can I declare signal in both place or only in .dat of my program? and when i used global in front of signal there was error. How can those signal be global?
You can not declare a signal in both places. In any of the cases it should work if properly declared. If your DAT file is declared as public as shown you will no more have problems declaring global variables in it.
1. Declare variables global in DAT file
2. Assign to those variables the current values of $AXIS_ACT in sps.sub
3. Do the conversion in sps.sub as SkyeFire illustrated.
4. Declare those signal range in Config.dat
5. Do the proper I/O mapping in the configuration
6. Make the conversion in the PLC program as you want.
7. Check all over again for possible errors.
Good luck