LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using labview C code

Hello,

I am a bit confused at writing the C code for the CIN. The3 code labview
gives me is:
CIN MgErr CINRun(LStrHandle var1) {

My code that I need to use needs the string input that IU had sent to the
CIN. What is the actual name of the variable that the string is passed as?
Is it LStrHandle, or var1, or the entire LStrHandle var1? Because my code
uses
messagesend(char), where char must be this variable that labview is sending.
I would apreciate any help I can get. This is the last issue I have with
my project before I can start debugging. Thanks

JMH
0 Kudos
Message 1 of 4
(3,025 Views)
JMH wrote:

> Hello,
>
> I am a bit confused at writing the C code for the CIN. The3 code labview
> gives me is:
> CIN MgErr CINRun(LStrHandle var1) {
>
> My code that I need to use needs the string input that IU had sent to the
> CIN. What is the actual name of the variable that the string is passed as?
> Is it LStrHandle, or var1, or the entire LStrHandle var1? Because my code
> uses
> messagesend(char), where char must be this variable that labview is sending.
> I would apreciate any help I can get. This is the last issue I have with
> my project before I can start debugging. Thanks
>
> JMH

Let's first back up and make some changes.
1) Decide how many and the types of inputs / outputs the CIN will use.
2) Create the Controls / Indicators / Constants on the Fr
ont Panel / diagram
2A) NAME ALL OF THESE ITEMS
3) Drop the CIN on the diagram start wiring the items to the CIN
[Right click on a terminal of the CIN and select 'Add Parameter' to get more
terminals]
4) Right click on the CIN and select 'Create .c file'

Now the Variables have names you can understand. IF you skip 2A then LabVIEW
will name
the variables as var1, var2, ......varN for the number of variables
(parameters) you add.

So to answer the question var1 in this case is the string coming into the CIN.

The LStrHandle is the datatype (in this case a pointer to a pointer to the
string ) of var1.

I don't want to offend you but I get the impression that you are not
comfortable
with C code and CINs. These are not for the faint of heart. I would strongly
suggest
you look for another solution to the problem before resorting to using CINs.

Of course if I have misinterpreted here you are more than welcome to send me a
lashing.
Good Luck
Kevin Kent
0 Kudos
Message 2 of 4
(3,025 Views)
Hi Kevin,

Yes, you are correct, I am uncomfortable with CINs or most labview programming,
for that matter. I tried your instructions, but unfortunately, no matter
what I do the variable is var1. Not that it particularily matters, because
I know that var 1 is my string, but still, it doesnt work. I was just wondering
if it is because Im using labview 5.1 perhaps?
Thanks

JMH



Now the Variables have names you can understand. IF you skip 2A then LabVIEW>will
name>the variables as var1, var2, ......varN for the number of variables>(parameters)
you add.>>So to answer the question var1 in this case is the string coming
into the CIN
0 Kudos
Message 3 of 4
(3,025 Views)
JMH wrote:

> Hi Kevin,
>
> Yes, you are correct, I am uncomfortable with CINs or most labview programming,
> for that matter. I tried your instructions, but unfortunately, no matter
> what I do the variable is var1. Not that it particularily matters, because
> I know that var 1 is my string, but still, it doesnt work. I was just wondering
> if it is because Im using labview 5.1 perhaps?
> Thanks
>
> JMH
>
> Now the Variables have names you can understand. IF you skip 2A then LabVIEW>will
> name>the variables as var1, var2, ......varN for the number of variables>(parameters)
> you add.>>So to answer the question var1 in this case is the string coming
> into the CIN

I did the exercise using 5.1 as I was writing the e-mail.
My platform is SUN ,
but I expect it to work the same on a PC.
I forgot to mention that you probably needed to delete the file
if you were using the same file name as the previous attempt.
Kevin Kent
0 Kudos
Message 4 of 4
(3,025 Views)