TECHNICAL MANUAL
620020E05
Due to the continuous products improvement, the indications of the present manual can be modified without previous warning and in any
case are a contract commitment. The present information publishing does not represent resignation of intellectual property or patent.
Copyright
2009-2010 S.A. Sistel -E 08211 BARCELONA
Pag. 11
4. Low level CAN commands
Following, details on all CAN messages available to manage the YAV904X8 module
YAV904x8
Action
Dir
Ident
Length
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
Set OFF One Relay
Rx
0x155102xx
4
0x02
0x01
Relay
0x00
Set ON One Relay
Rx
0x155102xx
4
0x02
0x01
Relay
0x01
TOGGLE One Relay
Rx
0x155102xx
4
0x02
0x01
Relay
0x02
BLINK One Relay
Rx
0x155102xx
4
0x02
0x01
Relay
0x03
PULSE ON One Relay
Rx
0x155102xx
5
0x02
0x01
Relay
0x04
Time (10ms)
PULSE OFF One Relay
Rx
0x155102xx
5
0x02
0x01
Relay
0x05
Time (10ms)
ASK One Relay
Rx
0x155102xx
3
0x02
0x02
Relay
One Relay Status Tx
0x155202xx
4
0x02
0x02
Relay
Status
Set OFF Several Relays
Rx
0x155102xx
7
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x00
Set ON Several Relays
Rx
0x155102xx
7
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x01
TOGGLE Several Relays
Rx
0x155102xx
7
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x02
BLINK Several Relays
Rx
0x155102xx
7
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x03
PULSE ON Several Relays
Rx
0x155102xx
8
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x04
Time (10ms)
PULSE OFF Several Relays
Rx
0x155102xx
8
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x05
Time (10ms)
Set OUT All Relays
Rx
0x155102xx
7
0x02
0x03
Relays 0
Relays 1
Relays 2
Relays 3
0x06
ASK ALL Relays
Rx
0x155102xx
3
0x02
0x04
Autosend
All Relays Status Tx
0x155202xx
6
0x02
0x04
Relays 0
Relays 1
Relays 2
Relays 3
Action
Dir
Ident
Length
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
Read I2C Data Word 24LC256
Rx
0x155102xx
5
0x02
0xFA
0xF1
ADD LOW
ADD HIGH
Write I2C Data Word 24LC256
Rx
0x155102xx
7
0x02
0xFA
0xF2
ADD LOW
ADD HIGH
DAT LOW
DAT HIGH
Write I2C Page (32 Words) 24LC256
Rx
0x155102xx
7
0x02
0xFA
0xF3
ADD LOW
ADD HIGH
DAT LOW
DAT HIGH
Write I2C All (16384 Words) 24LC256
Rx
0x155102xx
5
0x02
0xFA
0xF4
DAT LOW
DAT HIGH
Data Word Readed I2C 24LC256 Tx
0x155202xx
7
0x02
0xFA
0xF1
ADD LOW
ADD HIGH
DAT LOW
DAT HIGH
Action I2C OK 24LC256 Tx
0x155202xx
3
0x02
0xFA
0xF2
Action I2C NOT OK 24LC256 Tx
0x155202xx
3
0x02
0xFA
0xF3
4.1 Example: Managing a YAV board using C language
Following example is showing how to manage a YAV board by using NI-CAN interface and C
language.
We strongly recommend the software engineer to read NI-CAN manual for clear understand-
ing on how to implement the communication with YAV boards
(
http://www.ni.com/pdf/manuals/370289k.pdf
The YAV board used for this example is YAV904X8.
/************************************************************
Example showing how to command the YAV904X8 board from a PC,
using a National Instruments NICAN interface board.
To be compiled with MS Visual C as a console application.
************************************************************/
#include <stdio.h> // Include file for printf
#include <stdlib.h> // Include file for strtol
#include <windows.h> // Include file for Win32 time functions
#include <conio.h> // Include file for _getch/_kbhit
#include <string.h>
#include "Nican.h" // Include file for NI-CAN functions and constants
/* NI-CAN handle */
NCTYPE_OBJH TxHandle=0;