With this code i have flickering, bad...
Code: [Local Link Removed for Guests]
CLS
' HTML " Momentane Leistungsaufnahme: " + TEXTAREA$(Ergebnis$) + " W"
HTML " Momentane Leistungsaufnahme: " + TEXTBox$(Ergebnis$) + " W"
Code: [Local Link Removed for Guests]
CLS
' HTML " Momentane Leistungsaufnahme: " + TEXTAREA$(Ergebnis$) + " W"
HTML " Momentane Leistungsaufnahme: " + TEXTBox$(Ergebnis$) + " W"
Code: [Local Link Removed for Guests]
'MODBUS example - write and read in the HOLD_REGISTER 0
READ_HOLD_REGISTER = 3
READ_INPUT_REGISTER = 4
'WRITE_HOLD_REGISTER = 6
SERVER_ID = 1
' MODBUS.CONNECT IP$, [port] [,timeout] [,idleTimeout]
onWgetAsync modbus_received 'set the event handler function
pause 200
modbus.connect "192.168.0.200", 4196, 1000', 10 'address of the remote server
pause 200
for z = 1 to 1000 ' 100 X read ---- Anzahl der Leseung
'modbus.request 4567, SERVER_ID , READ_HOLD_REGISTER , 4157, 1 ' 16 bit
modbus.request 4567, SERVER_ID , READ_HOLD_REGISTER , 4157, 2 ' 32 Bit
pause 100
next z
end
modbus_received:
r$ = WGETRESULT$
'wlog r$
print r$
token$ = word$(r$, 1) 'extract the token (first word)
if (token$ ="4567") then ' if the token correspond to the read request
if (word$(r$, 2) <> "Error") then 'if is not an error
'assemble the 2 bytes in one 16 bits word
'value$ = "&h"+ word$(r$, 5) + word$(r$, 6)
'assemble the 4 bytes in one 32 bits word, it dosn't running
value$ = "&h"+ word$(r$, 5) + word$(r$, 6) + word$(r$, 7) + word$(r$, 8)
Ergebnis1= val(value$)
'wlog val(value$) 'converts from hex to integer
Ergebnis = ( CONVERT.FROM_IEEE754(Ergebnis1) * 1000)
Vortext$ = " Momentane Leistungsaufnahme: "
Ergebnis$ = str$(Ergebnis,"%6.2f") + " Watt"
CLS
' HTML " Momentane Leistungsaufnahme: " + TEXTAREA$(Ergebnis$) + " W"
' or
HTML " Momentane Leistungsaufnahme: " + TEXTBox$(Ergebnis$) + " W"
' wlog Ergebnis
end if
endif
return
Code: [Local Link Removed for Guests]
cls
Ergebnis = 0
HTML " Momentane Leistungsaufnahme: " + TEXTBox$(Ergebnis) + " W"
autorefresh 500 ' refresh automatically each 500msec
for z = 0 to 1000
Ergebnis = z * 10
pause 1000
next z
Code: [Local Link Removed for Guests]
cls
Ergebnis = 0
HTML " Momentane Leistungsaufnahme: " + TEXTBox$(Ergebnis) + " W"
for z = 0 to 1000
Ergebnis = z * 10
refresh
pause 1000
next z