Tests¶
Simple read/write¶
Command:
vtest("--rwtest 1000 0 1000 1 1000 1000")
Example of output:
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
file-handle: 7
8 bytes will be written, content of these 8 bytes:
1 2 3 4 5 6 7 8
set write-mode for object 1000, port 0 ...(timeout 1000)
done
set read-mode for object 1000, port 1 ...(timeout 1000)
done
now writing the data...done
message-status: VCAN_OK
now reading the data...done
message-content:
counter:1, datasize:8, data:
0: 1 2 3 4 5 6 7 8 " "
closing /dev/vcan
value = 0 = 0x0
Read and write on two hosts¶
Command on host 2:
vtest("--read 1000 0 10000")
Command on host 1:
vtest("--write 1000 0 1000")
Output on host 1:
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
file-handle: 11
defining write-object...
done
writing 0, 4 bytes
closing /dev/vcan
Output on host 2:
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
vwhost:bash: /dev/vcan: No such file or directory
file-handle: 9
defining read-object...
done
received: cnt:1, data:
0: 0 0 0 0 " "
closing /dev/vcan4
value = 0 = 0x0
Read timeout¶
Command:
vtest("--read 1000 0 5000")
Output (note that the last lines are printed after 5 seconds):
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
vwhost:bash: /dev/vcan: No such file or directory
file-handle: 9
defining read-object...
done
received: cnt:0, data:
message-status-flags:VCAN_OLD
message-error-code:VCAN_NO_ERROR
closing /dev/vcan4
value = 0 = 0x0
readnow¶
Command on host 1:
vtest("--readnow 1000 0 5000 --loop 1000 --sleep 0.5")
Command on host 2 (run this while cmd 1 runs):
vtest("--write 1000 0 1000 --loop 3 -q 4")
Output on host 1 (part of it):
received: cnt:0, data:
message-status-flags:VCAN_OLD
message-error-code:VCAN_NO_ERROR
received: cnt:2, data:
0: 0 0 0 1 " "
message-status-flags:VCAN_LOST
message-error-code:VCAN_NO_ERROR
received: cnt:2, data:
0: 0 0 0 1 " "
message-status-flags:VCAN_OLD
message-error-code:VCAN_NO_ERROR
received: cnt:2, data:
0: 0 0 0 1 " "
message-status-flags:VCAN_OLD
message-error-code:VCAN_NO_ERROR
received: cnt:2, data:
0: 0 0 0 1
Fast read and write on two hosts with loop¶
Command on host 1:
vtest("--read 1000 0 10000 --check --loop 50000 -q 3")
Command on host 2:
vtest("--write 1000 0 1000 --loop 50000 -q 3")
Output on host 1 (part of it):
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
vwhost:bash: /dev/vcan: No such file or directory
file-handle: 13
defining read-object...
done
one 'T' are 1000 loops!
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
closing /dev/vcan4
Note: if the sender is too fast for the receiver, the output may look like this:
7b6,b7b3|a7]L[b7ba,b7b7|ab]L[b7bd,b7bb|ae]L[b7c1,b7be|b2]L[b7c5,b7c2|b6]L
[b7ca,b7c6|bb]L[b7cd,b7cb|be]L[b7d1,b7ce|c2]L[b7d5,b7d2|c6]L
Try “-q 1” on the sender in this case.
Note on sender speeds:
mvme162: 360us / frame mv2100 : 180us / frame
writenow¶
Command on host 1:
vtest("--read 1000 0 10000 --check --loop 50000 -q 3")
Command on host 2:
vtest("--writenow-w 1000 0 1000 --loop 50000 -q 3")
Output on host 2:
opening /dev/vcan or /dev/vcan4 :
file-handle: 11
defining write-object...
done
one 'T' are 1000 loops!
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
closing /dev/vcan
Output on host 1 (sample):
7b6,b7b3|a7]L[b7ba,b7b7|ab]L[b7bd,b7bb|ae]L[b7c1,b7be|b2]L[b7c5,b7c2|b6]L
[b7ca,b7c6|bb]L[b7cd,b7cb|be]L[b7d1,b7ce|c2]L[b7d5,b7d2|c6]L
Now a slower test,
Command on host 1:
vtest("--read 1000 0 10000 --loop 10")
Command on host 2:
vtest("--writenow-w 1000 0 1000 --loop 10")
Output on host 1 (sample):
received: cnt:1, data:
0: 0 0 0 0 " "
received: cnt:2, data:
0: 0 0 0 1 " "
received: cnt:3, data:
0: 0 0 0 2 " "
received: cnt:4, data:
0: 0 0 0 3
Output on host 2 (sample):
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
file-handle: 11
defining write-object...
done
writing 0, 4 bytes
writing 1, 4 bytes
writing 2, 4 bytes
writetimed¶
Command on host 1:
vtest("--read 1000 0 10000 --check --loop 50000 -q 3")
Command on host 2:
vtest("--writetimed 1000 0 1000 200 --loop 50000 -q 3")
Output on host 1:
opening /dev/vcan or /dev/vcan4 : file-handle: 11 defining read-object… done one ‘T’ are 1000 loops! TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT closing /dev/vcan
Time measurements:
Command (example):
vtest("--writetimed 1000 0 1000 800 --loop 25000 -q 3")
loops inhibit loop-time-mv162[us] loop-time-mv2100[us]
100000 100 370 280
100000 200 450 380
50000 400 660 580
25000 800 1040 960
remote-read¶
Command on host 1:
vtest("--read 1000 0 10000 --remote --loop 10")
Command on host 2:
vtest("--write 1000 0 1000 --loop 10000000 -q 4 --remote --consistence")
Output on host 1:
received: cnt:3, data:
0: A6 A6 A6 A6 A6 A6 A6 A6 " "
received: cnt:4, data:
0: B3 B3 B3 B3 B3 B3 B3 B3 " "
Due to a bug on the VCAN4 card, there (if host2 uses a VCAN4 card) looks like this (only the first 4 bytes are valid):
received: cnt:6, data:
0: E0 E0 E0 E0 0 0 7F FF " "
received: cnt:7, data:
0: F1 F1 F1 F1 0 0 7F FF " "
remote-read with timeout¶
Command on host:
vtest("--read 1000 0 5000 --remote --loop 2")
Output:
************vtest 2009-04-22 started****************
opening /dev/vcan or /dev/vcan4 :
vwhost:bash: /dev/vcan: No such file or directory
file-handle: 13
defining read-object...
done
received: cnt:467, data:
0: 0 16 90 4C " L"
message-status-flags:VCAN_TM_OUT VCAN_TX_ERR
message-error-code:VCAN_TX_TM_OUT
received: cnt:467, data:
0: 0 16 90 4C " L"
message-status-flags:VCAN_TM_OUT VCAN_TX_ERR
message-error-code:VCAN_TX_TM_OUT
closing /dev/vcan4
value = 0 = 0x0
queue-read¶
Command on host 1:
vtest("--queue_read 0 5000 1000 1001 --loop 10")
Command on host 2:
vtest("--write 1000 0 1000 --loop 5")
vtest("--write 1001 0 1000 --loop 5")
Output on host 1:
************vtest 2009-04-22 started****************
vwhost:bash: /dev/vcan: No such file or directory
opening /dev/vcan or /dev/vcan4 :
vwhost:bash: /dev/vcan: No such file or directory
file-handle: 13
defining read-objects...
done
the counter-semaphore mechanism will be used
defining signal-objects...
done
received on 1000: cnt:1, data:
0: 0 0 0 0 " "
received on 1000: cnt:2, data:
0: 0 0 0 1 " "
received on 1000: cnt:3, data:
0: 0 0 0 2 " "
received on 1000: cnt:4, data:
0: 0 0 0 3 " "
received on 1000: cnt:5, data:
0: 0 0 0 4 " "
received on 1001: cnt:1, data:
0: 0 0 0 0 " "
received on 1001: cnt:2, data:
0: 0 0 0 1 " "
received on 1001: cnt:3, data:
0: 0 0 0 2 " "
received on 1001: cnt:4, data:
0: 0 0 0 3 " "
received on 1001: cnt:5, data:
0: 0 0 0 4 " "
closing /dev/vcan4
value = 0 = 0x0
test consistency¶
Command on host 1:
vtest("--read 1000 0 10000 --remote --loop 100000 -q 3 --consistence")
Command on host 2:
vtest("--write 1000 0 1000 --loop 100000 -q 3 --consistence")