Did some quick googling, found this that should work for i2c on the arduino side.
Code:
#include <Wire.h>
void setup()
{
Wire.begin(2); // join i2c bus with address #2
Wire.onRequest(requestEvent); // register event
Serial.begin(9600); // start serial for output
}
void loop()
{
delay(100);
}
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void requestEvent()
{
static char c = '0';
Wire.send(c++);
if (c > 'z')
c = '0';
}
Also, the i2c libraries for the cRIO only support master mode... With good reason. Conceptually, the cRIO is the master of all of the networks onboard the robot, because it collects data and uses it to move the robot.