Sto provando a comunicare con il puntatore tramite Free protocol ma non riesco ad avere risposta dal dispositivo, ne su pannello ne dall’accensione del laser.
Questo è il codice con cui sto lavorando
macro_command main()
short wResponse[2], receive_len
char byCommand[9]
bool stato
GetData(stato, “Local HMI”, LB, 1, 1)
if stato then
StringCopy(“LASER ON”, byCommand[0])
SetData(byCommand[0], “Local HMI”, LW, 1000, 9)
OUTPORT(byCommand[0], “Free Protocol”, 9)// send 4 bytes
end if
if not stato then
StringCopy(“LASER OFF”, byCommand[0])
SetData(byCommand[0], “Local HMI”, LW, 1000, 9)
OUTPORT(byCommand[0], “Free Protocol”, 9)// send 4 bytes
end if
DELAY(1000)
INPORT(wResponse[0], “Free Protocol”, 2, receive_len)// read 144 words
if receive_len >= 1 then
SetData(wResponse[0], “Local HMI”, LW, 145, 2)// set responses to LW0
end if
end macro_command