I am using kuka's devicenet to control trumpf laser. It is possible to combine digital outputs so I can set power using decimal numbers?
I/O
-
Andrew Socha -
June 4, 2019 at 6:23 PM -
Thread is marked as Resolved.
-
-
Andrew,
I'm going to make a wild assumption that you're using a KRC4 / KSS 8.3...
You can set a certain set of outputs as a SIGNAL type, and use simple data types. For example:
CodeDECL SIGNAL start $OUT[100] ;for a boolian DECL SIGNAL position $OUT[10] TO $OUT[17] ;for an 8-bit integer
For decimal values between -10.0 and +10.0, you could use an analog output.
Hope that helps.
-
Any multi-bit SIGNAL declaration from 2 to 31 bits is treated as an unsigned integer. Any SIGNAL declared 32bits in size is treated as a signed integer. SIGNALs larger thatn 32bits are not legal.
Once the signal has been declared, the assigned name becomes available as an integer variable. So:
CodeDECL SIGNAL OutByte $OUT[1] TO $OUT[8] ; 8 bits DECL SIGNAL OutNibble $OUT[9] TO $OUT[12] ; 4 bits DECL SIGNAL OutPair $OUT[13] TO $OUT[14] ; 2 bits DECL SIGNAL OutDblWord $OUT[17] TO $OUT[48] ; 32-bit signed integer OutByte = 255 ; all 8 bits set True OutByte = 128 ; only the 8th bit set true OutPair = 3 ; both bits set true OutPair = 4 ; too big for 2 bits, will fault program OutDblWord = 2147483647 ; first 31 bits set true OutDblWord = -1 ; 32nd and first bits set true
-
I am using KRC 2. Thank you for helping.
-
Check on Laser side there are 16bit assigned for laser power.Use them as SIGNAL as previously described or link to analog output.