There is more than one type of event for a DataSocket callback (Status updates and data updates). See the documentation of DS_Open. You are probably getting a status update as well as a data update. If you put in a switch statement to only act on the DS_EVENT_DATAUPDATED event, then it should only execute that code once.
Best Regards,
Chris Matthews
Measurement Studio Support Manager