I have two PCAN-SUB-FD devices connected to each other. I have to develop LUA applications for the devices to be integrated in our workflow.
For development I control the first one with a LUA script and the second one with the PCAN-View. In LUA I load the provided DLL.
The following is already working without any problems:
Code: Select all
LUA script transmits CAN Message over first device => CAN Message is received on second device and displayed in PCAN-View
Now to the other direction:
Code: Select all
PCAN-View transmits CAN Message over second device => CAN Message is printed out on LUA command Line
The messages are received but at the beginning always two CAN Messages are added with all data bytes set to ZERO and I don't know what's going wrong here:
Code: Select all
Program starting as '"D:\Entwicklung\ZeroBraneStudio-1.70\bin\lua.exe" -e "io.stdout:setvbuf('no')" "D:\Entwicklung\Lua\scripts\Pcan_ReadMsg.lua"'.
Program 'lua.exe' started in 'D:\Entwicklung\Lua\scripts' (pid: 8236).
-- Starting suite "main", 1 test(s)
Available Device Nr. 1: 0x51
===============================
Message ID: 0x1
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Timestamp: 0xA324A34A
Message ID: 0x1
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Msg: Received Data: 0x0
Timestamp: 0xA324A4C3
Message ID: 0x5
Msg: Received Data: 0x57
Msg: Received Data: 0x12
Msg: Received Data: 0x34
Msg: Received Data: 0x15
Msg: Received Data: 0x8A
Msg: Received Data: 0xBC
Msg: Received Data: 0xF8
Msg: Received Data: 0xE4
Timestamp: 0xA324A7C9
Message ID: 0x5
Msg: Received Data: 0x57
Msg: Received Data: 0x12
Msg: Received Data: 0x34
Msg: Received Data: 0x15
Msg: Received Data: 0x8A
Msg: Received Data: 0xBC
Msg: Received Data: 0xF8
Msg: Received Data: 0xE4
Timestamp: 0xA324A9ED
Message ID: 0x5
Msg: Received Data: 0x57
Msg: Received Data: 0x12
Msg: Received Data: 0x34
Msg: Received Data: 0x15
Msg: Received Data: 0x8A
Msg: Received Data: 0xBC
Msg: Received Data: 0xF8
Msg: Received Data: 0xE4
Timestamp: 0xA324AC12
Message ID: 0x5
Msg: Received Data: 0x57
Msg: Received Data: 0x12
Msg: Received Data: 0x34
Msg: Received Data: 0x15
Msg: Received Data: 0x8A
Msg: Received Data: 0xBC
Msg: Received Data: 0xF8
Msg: Received Data: 0xE4
Timestamp: 0xA324AE36
CAN Queue ist empty: Status 0x20
.
---- Testing finished in 469.00 ms, with 2 assertion(s) ----
1 passed, 0 failed, 0 error(s), 0 skipped.
Program completed in 0.61 seconds (pid: 8236).
If I call the script after 10 seconds I receive 2 valid frames and the two additional "false" frames. If I call the scripts ater 60 seconds, I receive 12 valid frames and again the two additional "false" frames.
I'm very glad for any hints!
Kind regards
Sebastian