- Posts: 31
- Thank you received: 0
unknown type name ‘bit’
1 year 5 months ago #328967
by Z3rni3
unknown type name ‘bit’ was created by Z3rni3
Hey Guys
I'm trying to write a function at the moment but it does'nt accept me using a bit.
Probably jsut missing something small.
I get following Error with following function;
CODE:
pos_latch.c:29:5: error: unknown type name ‘bit’
29 | bit last_Tin;
| ^~~
make: *** [/usr/share/linuxcnc/Makefile.modinc:117: pos_latch.o] Error 1
FUNCTION:
component pos_latch;
license "GPL";
pin in float Pin;
pin in bit Tin;
pin out float out;
variable bit last_Tin = FALSE;
function _;
;;
FUNCTION(_) {
if (Tin && !last_Tin) {
out = Pin;
}
last_Tin = Tin;
}
I'm trying to write a function at the moment but it does'nt accept me using a bit.
Probably jsut missing something small.
I get following Error with following function;
CODE:
pos_latch.c:29:5: error: unknown type name ‘bit’
29 | bit last_Tin;
| ^~~
make: *** [/usr/share/linuxcnc/Makefile.modinc:117: pos_latch.o] Error 1
FUNCTION:
component pos_latch;
license "GPL";
pin in float Pin;
pin in bit Tin;
pin out float out;
variable bit last_Tin = FALSE;
function _;
;;
FUNCTION(_) {
if (Tin && !last_Tin) {
out = Pin;
}
last_Tin = Tin;
}
Please Log in to join the conversation.
1 year 5 months ago #328968
by Hakan
Replied by Hakan on topic unknown type name ‘bit’
Name the file pos_latch.comp, the comp thing makes it go through the preprocessor.
Please Log in to join the conversation.
1 year 5 months ago #328970
by Z3rni3
Replied by Z3rni3 on topic unknown type name ‘bit’
I acctually name it pos_latch.comp when creating the document.
I've created working functions before but those only used floats.
Follwing File installs no problem...:
I've created working functions before but those only used floats.
Follwing File installs no problem...:
Code:
component Test;
license "GPL";
pin in float in;
pin out float out1;
pin out bit out2;
function _ nofp;
;;
FUNCTION(_) {
out1 = in * 3;
if (out1 == 3.0)
{ out2 = true; }
else
{ out2 = false; }
}
Please Log in to join the conversation.
1 year 5 months ago #328971
by cmorley
Replied by cmorley on topic unknown type name ‘bit’
try:
variable int last_Tin = 0;
variable int last_Tin = 0;
Please Log in to join the conversation.
Time to create page: 0.145 seconds
