Commit 341fbc44 authored by Joshua Supra's avatar Joshua Supra
Browse files

changed PiLC2GetIOCardStatuD pt100 and thermo value to raw value

parent 63b60d1d
......@@ -142,7 +142,7 @@ int main (int argc, char *argv[]){
void *network(void *args){
zmq_data *zmq_rec_data = (zmq_data *)args;
printf("%i\n", zmq_rec_data->NrOfBytes);
//printf("%i\n", zmq_rec_data->NrOfBytes);
unsigned int command;
unsigned int nbytes;
int status;
......
......@@ -245,17 +245,17 @@ int GetIOCardRegister(IOCardStruct *IOCard) {
if (IOCard[i-1].TypeID == DIFF_ADC) {
IOCard[i].Register_value = getDADCRawvalue((i-1)/2);
} else if (IOCard[i-1].TypeID == THERMO) {
IOCard[i].Register_value = getThermovalue(((i-1)/2+16));
IOCard[i].Register_value = getThermoRawvalue(((i-1)/2+16));
} else if (IOCard[i-1].TypeID == PT100){
IOCard[i].Register_value = getPT100value(((i-1)/4+16));
IOCard[i].Register_value = getPT100RawValue(((i-1)/4+16));
} else if (IOCard[i+1].TypeID == PT100){
IOCard[i].Register_value = getPT100value(((i+1)/4+16));
IOCard[i].Register_value = getPT100RawValue(((i+1)/4+16));
}
//printf("%i: %.x8\n",i+1, IOCard[i].Register_value);
break;
case THERMO: IOCard[i].Register_value = getThermovalue(((i)/2+16));break;
case THERMO: IOCard[i].Register_value = getThermoRawvalue(((i)/2+16));break;
case PT100: IOCard[i].Register_value = getPT100value(((i)/4+16));break;
case PT100: IOCard[i].Register_value = getPT100RawValue(((i)/4+16));break;
}
}else {
......
......@@ -57,13 +57,13 @@ int deinit_network(void){
int FunctionCall(zmq_data *zmq_data_struct){
unsigned int FunctionNumber;
unsigned int funcArg[zmq_data_struct->NrOfBytes-2];
unsigned int command = *(unsigned int *)zmq_data_struct->data;
unsigned int command = zmq_data_struct->data[0];
int nbytes = 0;
int value = 0;
zmq_data_struct->data +=4;
FunctionNumber = *(unsigned int*)zmq_data_struct->data;
//printf("bytes: %d, ", numberofbytes);
//printf("func nr: %.8x,", FunctionNumber);
FunctionNumber = zmq_data_struct->data[1];
//printf("bytes: %d\n", zmq_data_struct->NrOfBytes);
//printf("func nr: %.8x\n", FunctionNumber);
zmq_data_struct->data +=4;
for(int i = 0; i < ((zmq_data_struct->NrOfBytes)>>2)-2; i++){
funcArg[i] = *(unsigned int *)zmq_data_struct->data;
......
......@@ -8,3 +8,9 @@ unsigned int getPT100value(unsigned int PT100channel) {
return value;
}
unsigned int getPT100RawValue(unsigned int PT100channel) {
unsigned int value = ReadFPGA(PILC_PT100_OFFSET+PT100channel+PILC_PT100_RAW_OFFSET);
return value;
}
......@@ -5,5 +5,13 @@
#define PILC_PT100_CH_2 0x12
#define PILC_PT100_CH_3 0x13
#define PILC_PT100_RAW_CH_0 0x14
#define PILC_PT100_RAW_CH_1 0x15
#define PILC_PT100_RAW_CH_2 0x16
#define PILC_PT100_RAW_CH_3 0x17
#define PILC_PT100_RAW_OFFSET 0x4
#define NO_PT100 0x00f06400
unsigned int getPT100value(unsigned int PT100channel);
unsigned int getPT100RawValue(unsigned int PT100channel);
......@@ -7,3 +7,12 @@ unsigned int getThermovalue(unsigned int Thermochannel){
return value;
}
unsigned int getThermoRawvalue(unsigned int Thermochannel){
unsigned int value = ReadFPGA(PILC_THERMO_OFFSET+Thermochannel+PILC_THERMO_RAW_OFFSET);
return value;
}
......@@ -10,6 +10,19 @@
#define PILC_THERMO_CH_6 0x16
#define PILC_THERMO_CH_7 0x17
#define PILC_THERMO_RAW_CH_0 0x10
#define PILC_THERMO_RAW__CH_1 0x11
#define PILC_THERMO_RAW__CH_2 0x12
#define PILC_THERMO_RAW__CH_3 0x13
#define PILC_THERMO_RAW__CH_4 0x14
#define PILC_THERMO_RAW__CH_5 0x15
#define PILC_THERMO_RAW__CH_6 0x16
#define PILC_THERMO_RAW__CH_7 0x17
#define PILC_THERMO_RAW_OFFSET 0x8
#define NO_THERMO_COUPLE 0x2000
unsigned int getThermovalue(unsigned int Thermochannel);
unsigned int getThermoRawvalue(unsigned int Thermochannel);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment