JMH wrote:
Not sure if I understand correctly but here is some info.
If you have C code and can make it into a DLL (assuming WinX machine)
then you can call the DLL directly from LabVIEW using the CLF (Call Library
Function).
Drop the CLF on the diagram, right click and point to the DLL and define the
inputs and outputs. LabVIEW can send and receive strings quite easily usgin
DLLs.
The CIN has a couple of purposes:
1) It allows you to write small pieces of C code to use in LabVIEW.
2) If your DLL's need pointers (which LabVIEW can't pass)
you can create a CIN 'wrapper' that translates the pointers to and from
datatypes that LabVIEW understands.
Now for your question as I understand it.
If the code is fairly small and not worth a DLL then use the CIN.
Drop it on the diagram and define what the inputs and outputs should be.
Create the c file and it will have the framework you need and will understand
what the inputs / outputs are supposed to be. Drop in your code and make
any adjustements needed (Like chaning the variable names to what Labview is
calling the Inputs/ Outputs. Follow the process in the manual to build the lsb
file
and you are ready to go.
Hope this at leaat points you in the right direction.
Kevin Kent
> hello,
>
> I am trying to write labview for an instrument, which has an old controller
> card with no drivers. It is operated through basic code, and can work through
> C code, as I have made that too. Now, however, I want to operate the entire
> machine in labview. this card is my only problem, as I am not familiar with
> using CINs.
> What I need to do is use the code that I have, but have the inputs done in
> labview, and then make a string of command syntax, which then can have all
> the proper codes to operate the motor according to the determined values.
> So, what needs to happen is the user sets the speed and time the motor shall
> spin, and then it will take that data, make it an alphanumeric string, and
> send it to the CIN as an input, so the C code can take that input and send
> it to the card and thus the motor to spin it. I dont understand the process
> of how the CIN passes the information as an input to the C code. I read the
> book on writing CINs, andit shows that it makes a c file that then I add
> my code to. Is that the simplicity of it? The labview c file that I paste
> all my code into already knows how to obtain the data that I want labview
> to pass on, and so then I can just make the routine that does the operation
> take that string which is being sent and is there in the program and send
> it directly to the card?
>
> I would appreciate any help on the process of passing info from labview to
> a CIN. I am sorry if my question is unclear. Thanks for your time.
>
> JMH