programming "openDAQ" data acquisition device

Hello,
I’m using an Arduino-compatible data acquisition device, “openDAQ”, to acquire electric power data. I’m trying to learn how to program it by writing an openDAQ version of “Blink”. I’ve looked in several of the Arduino forums and performed searches for existing code to learn from, but haven’t found any so far. I’ve modified blink to the following, know that it won’t work as is, but am not sure what types of things I need to add. Does anyone know of existing code for this device that I could learn from ?
Thanks,
Paul

 /*
  openDAQ_Blink
  A modification of the Arduino sketch “Blink” to turn the openDAQ LED 
  from green, to orange, to red, with a 1 second pause between each color change.
  modified 17 December 2014
  by Paul_L
 */
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin "unknown" as an output. I don't know the pin number for the openDAQ LED. 
  pinMode(unknown, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
  digitalWrite(unknown, 1);   // turn the LED green
  delay(1000);                // wait for one second
  digitalWrite(unknown, 2);   // turn the LED orange
  delay(1000);                // wait for one second
  digitalWrite(unknown, 3);   // turn the LED red
  delay(1000);                // wait for one second
}

Have you looked at the manual for the openDAQ?
Have you looked at the reference page for digitalWrite()?

tmd3- thanks for the suggestions.

I’ve re-read the manual and reviewed digitalWrite().
From the manual there are 2 sections that seem relevant.

(1) Regular Command Format
Normal openDAQ commands or Regular Commands use a minimum of 4 bytes to transmit a message to the device. Maximum allowed length for these packets is 64 bytes. First two bytes consist on a 16 bit checksum or CRC. This checksum is calculated doing the sum of all other bytes in the packet into a 16 bit integer. Then, the result is complemented. Be aware that some commands transmit 16 bit integers, and they do it in Big-Endian format (higher bytes first), while Arduino stores variables in its memory in Little-Endian format (lower bytes first).

Device will react to all these commands with a response with the same command number and different fields of data depending on the command. (Command-Response mode)

(2) Modifying boards.txt and pins_arduino.h
I modified both these files and am able to select the openDAQ in the Boards menu of the Arduino IDE.

commdata.cpp
It was suggested that I look at commdata.cpp. This was one of many files from:

This is the only reference to an LED command.

case C_LED_W:
            byte1 = input_data[4];
            ledSet(LEDGREEN, byte1 & 0x01);
            ledSet(LEDRED, byte1 & 0x02);

            response[4] = byte1;
            resp_len = 1;

            _DEBUG("C_LED_W: %d\r\n", byte1);
            break;

DigitalWrite() does seem to be the command to use. It seems that I need to ask the makers of openDAQ for the pin numbers of the green and red LEDs.
Thanks,
Paul

Screen Shot 2014-12-18 at 4.11.32 PM.png

Paul_L:
DigitalWrite() does seem to be the command to use.

Maybe so, I can't tell. I can't speak to how the openDAQ works. But, for the Arduino, this statement -

 digitalWrite(unknown, 3);   // turn the LED red

isn't how digitalWrite() is used. The first argument to digitalWrite() is a pin number, and the second is a value to write to that pin. If the second argument is zero, it sets the pin to a low output; if it's anything else, it sets the pin to a high output. In your sketch, it looks like you're trying to write multiple non-zero values to the same pin, called, "unknown," and hoping that different pins will go high. In fact, it'll just set the same pin high three times.

I see in the opeDAQ documentation that you can reprogram its firmware using a modified version of the Arduino IDE. The portion of the openDAQ support page addressing the Arduino IDE says,

People interested in doing more advanced experiments with the openDAQ will probably be looking forward to changing the firmware inside the device.

That suggests that programming the openDAQ with the Arduino IDE is a "more advanced" function than simply operating it. I'm wondering if the phrase, "Arduino compatible," as you apply it to the openDAQ, really means that you can easily upload and run sketches on it. It appears that the device is primarily intended to operate with a computer running python or LabView, rather than as a platform for running your own code, and that reprogramming the openDAQ firmware is an advanced activity that highly experienced might want to do.

Note, though, that I've never used an openDAQ. This is the first that I've heard of it. Others with experience with this device may have a different opinion. I hope they'll chime in.