Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FS-ELAB
pilc2server_old
Commits
341fbc44
Commit
341fbc44
authored
Jan 24, 2022
by
Joshua Supra
Browse files
changed PiLC2GetIOCardStatuD pt100 and thermo value to raw value
parent
63b60d1d
Changes
8
Hide whitespace changes
Inline
Side-by-side
main.c
View file @
341fbc44
...
...
@@ -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
;
...
...
pilc2_functions/libpilc2.a
View file @
341fbc44
No preview for this file type
pilc2_functions/pilc2_IO_GPIOs.c
View file @
341fbc44
...
...
@@ -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
=
getThermo
Raw
value
(((
i
-
1
)
/
2
+
16
));
}
else
if
(
IOCard
[
i
-
1
].
TypeID
==
PT100
){
IOCard
[
i
].
Register_value
=
getPT100
v
alue
(((
i
-
1
)
/
4
+
16
));
IOCard
[
i
].
Register_value
=
getPT100
RawV
alue
(((
i
-
1
)
/
4
+
16
));
}
else
if
(
IOCard
[
i
+
1
].
TypeID
==
PT100
){
IOCard
[
i
].
Register_value
=
getPT100
v
alue
(((
i
+
1
)
/
4
+
16
));
IOCard
[
i
].
Register_value
=
getPT100
RawV
alue
(((
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
=
getThermo
Raw
value
(((
i
)
/
2
+
16
));
break
;
case
PT100
:
IOCard
[
i
].
Register_value
=
getPT100
v
alue
(((
i
)
/
4
+
16
));
break
;
case
PT100
:
IOCard
[
i
].
Register_value
=
getPT100
RawV
alue
(((
i
)
/
4
+
16
));
break
;
}
}
else
{
...
...
pilc2_functions/pilc2_network.c
View file @
341fbc44
...
...
@@ -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
,
",
numberofb
ytes);
//printf("func nr: %.8x
,
", FunctionNumber);
FunctionNumber
=
zmq_data_struct
->
data
[
1
]
;
//printf("bytes: %d
\n
",
zmq_data_struct->NrOfB
ytes);
//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
;
...
...
pilc2_functions/pilc2_pt100.c
View file @
341fbc44
...
...
@@ -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
;
}
pilc2_functions/pilc2_pt100.h
View file @
341fbc44
...
...
@@ -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
);
pilc2_functions/pilc2_thermo.c
View file @
341fbc44
...
...
@@ -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
;
}
pilc2_functions/pilc2_thermo.h
View file @
341fbc44
...
...
@@ -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
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment