Hardware connections
CAN-H of both sides should be connected together and CAN-L of both sides should be connected together as well. A 120 Ohm resistor must be connected on the CAN bus, between CAN-H and CAN-L
CAN Open configuration
CAN Open should be configured at the same Bit rate and enabled on the controller and on the magnetic sensor. Configure the TPDO 1 of the MGS with the desired tape position sent rate. 10 ms in an aqequate sent rate.
The MGS will automatically transmit the following parameters through TPDO 1:
On the controller side, the TPDO 1 will be automtically mapped in tyhe RPDO 1 parameter:
That means that left Track and right track will be mapped at User Var 9 and MGS flags will be mapped at user Var 10
What's left is to create a script that will run on the controller and extract the Left and Right track information from the user Var 9. A sample script follows:
option explicit
dim leftTrack as integer
dim rightTrack as integer
start:
leftTrack = getvalue(_VAR,9) and 0xFFFF
rightTrack = (getvalue(_VAR,9) >> 16) and 0xFFFF
print(leftTrack,"\t",rightTrack)
wait(10) 'loop period is 10 ms
goto start