16
Technical support / READING A COUNTER
« on: January 08, 2003, 08:43:40 AM »
I'm trying to read the value of a counter. The Master is a T100MD and the slave is a T40. I set the counter to 400.
1. Are the T40's counters only decremental counters?
2. I want to read the value of the counter every minute and save the value in a variable or DM, and after a read, send a comand to reset the value of the counter (400 ).
I use a dCusF with a 1min contact.
B$ = NETCMD$(3,"@02RU0C") ' Read SPEED-COUNTER (#13) preset value
IF LEN(B$) = 0 RETURN: ENDIF ' Not getting response
DM[102] = HEXVAL(MID$(B$,6,2))
C$= NETCMD$(3,"@02WU0C0000") ' CLEAR SPEED COUNTER PRESET VALUE
where is the problem if that is posible.
1. Are the T40's counters only decremental counters?
2. I want to read the value of the counter every minute and save the value in a variable or DM, and after a read, send a comand to reset the value of the counter (400 ).
I use a dCusF with a 1min contact.
B$ = NETCMD$(3,"@02RU0C") ' Read SPEED-COUNTER (#13) preset value
IF LEN(B$) = 0 RETURN: ENDIF ' Not getting response
DM[102] = HEXVAL(MID$(B$,6,2))
C$= NETCMD$(3,"@02WU0C0000") ' CLEAR SPEED COUNTER PRESET VALUE
where is the problem if that is posible.