Commit 57cfac2b by zacharyc

Changed output format so that numbers are between 0 and 65536 instead of

signed output. This matches LabJack behavior


git-svn-id: https://bucket.mit.edu/svn/nilm/acquisition/ethstream@7141 ddd99763-3ecb-0310-9145-efcb8ce7c51f
parent 5b731f3e
Showing with 4 additions and 3 deletions
...@@ -131,7 +131,7 @@ int nerd_data_stream(int data_fd, char * command, int numChannels, int *channel_ ...@@ -131,7 +131,7 @@ int nerd_data_stream(int data_fd, char * command, int numChannels, int *channel_
int ret = 0; int ret = 0;
int alignment = 0; int alignment = 0;
signed short datapoint = 0; signed short datapoint = 0;
signed short dataline[NERDJACK_CHANNELS]; unsigned short dataline[NERDJACK_CHANNELS];
long double voltline[NERDJACK_CHANNELS]; long double voltline[NERDJACK_CHANNELS];
deststruct destination[NERDJACK_CHANNELS]; deststruct destination[NERDJACK_CHANNELS];
int tempdestlist[NERDJACK_CHANNELS]; int tempdestlist[NERDJACK_CHANNELS];
...@@ -247,7 +247,8 @@ int nerd_data_stream(int data_fd, char * command, int numChannels, int *channel_ ...@@ -247,7 +247,8 @@ int nerd_data_stream(int data_fd, char * command, int numChannels, int *channel_
} }
} else { } else {
for(i = 0; i < destination[alignment].numCopies; i++) { for(i = 0; i < destination[alignment].numCopies; i++) {
dataline[destination[alignment].destlist[i]] = datapoint; dataline[destination[alignment].destlist[i]] =
(unsigned short) (datapoint - INT16_MIN);
} }
} }
...@@ -268,7 +269,7 @@ int nerd_data_stream(int data_fd, char * command, int numChannels, int *channel_ ...@@ -268,7 +269,7 @@ int nerd_data_stream(int data_fd, char * command, int numChannels, int *channel_
} }
} else { } else {
for(i = 0; i < numChannels; i++) { for(i = 0; i < numChannels; i++) {
printf("%hd ",dataline[i]); printf("%hu ",dataline[i]);
} }
} }
printf("\n"); printf("\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment