Hi, Does anyone work with HIWIN robot?
HIWIN ROBOT
-
Vadimas -
January 7, 2021 at 9:55 AM -
Thread is Unresolved
-
-
Does someon know how to map SI/SO to a register?
For getting some numbers from I/O by binary
-
Not a HIWIN specialist here.
Although HIWIN HRL language is heavily "inspired" on KUKA KRL, as far I know, there isn't a SIGNAL instruction to make what You want.
But on HIWIN library there is a program called BIT, that I suppose do more or less what You want.
Code
Display MoreDEFFCT INT BIT(A:IN, B:IN) INT A, B, I, J, N, S, T T = 0 S = 0 N = B - A + 1 J = 0 WHILE J < N I = 0 IF $DI[A+J] == TRUE THEN T = 1 ELSE T = 0 ENDIF WHILE I < J T = T*2 I = I + 1 ENDWHILE S = S + T J = J + 1 ENDWHILE RETURN S ENDFCT
Where A would be the first bit of the group, and B would be the last.
On your program, You should call BIT routine, and use a counter to store the returned value, more or less like this.
You will obviously need to customize BIT program to Your needs, but I think this is the path to achieve what You want.
-