Art Net Message Structure for C++ Implementation

alexbeim's picture

Hello All,

First I realize this is not for C++ dev and apologize but I am completely stuck.

We're using the Kineme Artnet Sender Patch for Quartz with no problem on the Mac and it works great.

However we're trying to develop a simple app for the PC.

I'm trying to form my Art-Net message to be sent via UDP from a C++ application.

While my message is being sent to my board (correct ip, port, can see data transfer light blink) it fails to control my lights.

Here is my message:

   message = new uint8_t[dataSize];
        message[0] = 'A';
        message[1] = 'r';
        message[2] = 't';
        message[3] = '-';
        message[4] = 'N';
        message[5] = 'e';
        message[6] = 't';
        message[7] = 0;
        //OPCODE
        message[8] = hex2int("0x00"); //OpCode Low Byte as per spec
        message[9] = hex2int("0x50"); //OpCode High Byte as per spec
        //VERSION
        message[10] = 0; //ver High
        message[11] = 14; //ver Low
        //SEQUENCE (FRAME)
        message[12] = frame; //current frame number
        //PHYSICAL PORT
        message[13] = 0; //not sure what this should be set to???
        //UNIVERSE
        message[14] = hex2int("0x21"); //universe low byte first (my universe is 1???
        message[15] = 0; //universe high byte
        //DMX LENGTH
        message[16] = 0; //HI Byte
        message[17] = universeSize; //LOW Byte (150)
        //DMX DATA
        for (int i = 0; i < universeSize; i++)
        {
            message[18 + i] = 0;
        }

Thank you in advance for any help and apologies again for posting to the Quartz Programming Forum.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

alexbeim's picture
Re: Art Net Message Structure for C++ Implementation

Sorry for the poor formatting, attached is the message I'm trying to send.

PreviewAttachmentSize
message.txt745 bytes

cwright's picture
Re: Art Net Message Structure for C++ Implementation

hex2int? why not just ... 0x21 etc.?

the array is dataSize bytes long, but you're filling in 18+universeSize bytes. that might be problematic.

new's a sorta clunky way to allocate an array; on the stack would be fine.

you might be selecting the incorrect universe by using 0x21 instead of 1. You might want to send all 512 channels (many dmx receivers don't like "short" universes). And you might want to send something other than 0s.

dr.light's picture
Re: Art Net Message Structure for C++ Implementation

hey alex - im bouncing your cry for help over to a coder friend of mine who writes a lot of ArtNet stuff for uCs and whatnot. He should be able to sort you. Im actually sitting in the tech office in BMP japan - we were all just talking about you and the Zygotes. I had chicken rice yesterday and thought of you! Hope you are doing well

-j. fleitell