LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

convert c code to Lab Windows CVI

Solved!
Go to solution

HI !

    I am new to LabWindow CVI environment and coding.

    I have an old C code with assignements and function that are giving compliation error. If some one point out the mistakes that I am doing would be great help.

 

int head =3D 1;
 int tail =3D 1;

void interrupt R_COMM1();        /* Function to handle com1 interrupts =
*/
 void interrupt (*oldfunct)();    /* Function to hold the comm1 int =
vector */
 void interrupt R_COMM2();        /* Function to handle com2 interrupts =

 

unsigned char     tempbyte;
    tempbyte =3D inportb(LSR_1);
    tempbyte =3D inportb(INTCL);  /* 8259 interupt mask register */
    tempbyte =3D tempbyte & 0xef;
    outportb(INTCL,tempbyte);

 

Thanks

0 Kudos
Message 1 of 5
(3,916 Views)

gajendra:

 

CVI is based on ANSI C, so you don't have to "convert" c to CVI.

 

What errors are you getting?  It will be easier for us to help you if you can be specific with your problem instead of just posting a snippet of code and asking us what's wrong.  You may need to post more of your code for us to see what's wrong.  You can attach files (like your .c and .h files) instead of cutting and pasting code.

 

What are all the instances of "=3D"?  I don't recognize that combination.  It may be some artifact of your cut and paste.

 

There is no closing */ after the following statement.

void interrupt R_COMM2();        /* Function to handle com2 interrupts =

The compiler will consider everything a comment until the end of the following line.

 tempbyte =3D inportb(INTCL);  /* 8259 interupt mask register */

 

What is the intent of the following statement?

tempbyte =3D tempbyte & 0xef;
0xef is after the end of the statement on the first part of the line (c statements end with a ; ).  It's not part of an assignment.  It's like an orphaned constant.

 

You have multiple variables and apparent constants that aren't defined in this shippet of code.  They may be defined elsewhere: LSR_1, INTCL, amp.

 

0 Kudos
Message 2 of 5
(3,894 Views)
Solution
Accepted by gajendra

The & in the line below may be part of a bad html paste.

tempbyte =3D tempbyte & 0xef;

 

Please compare the code as it is displayed in your original post with the code as displayed in the CVI editor, and repost the code as required, with added details on your compile errors.

0 Kudos
Message 3 of 5
(3,876 Views)

yeah my bad had copied over the html conversion , thanks for pointing that out .

0 Kudos
Message 4 of 5
(3,804 Views)

Are you still having problems?  If so, you can always attach your code as ascii (text).

0 Kudos
Message 5 of 5
(3,758 Views)