LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using problems MS Winsock Control In CVI

Hi.
I'm have problems using MS Winsock Control(ver 6.0) in CVI
When data send to another system, I set to 'variant' type from variable or array.
And send to another system.
 
problems is..
 
Set to variant type from variable(int, double, float...) is a good. (no problem)
But 1D array(int i[10], double d[10]...) is a bed. (problem)
 
my code is..
 
1. variable(no problem)
int  i=10;
CA_VariantSetInt (&varData, 10);
MSWinsockLib_IMSWinsockControlSendData (hSocket, NULL, varData);
 
 
2. 1D array(problem)
int  ia[10]={1,2,3,4,5,6,7,8,9,10};
CA_VariantSet1DArray (&varData, CAVT_INT, 10, ia); 
MSWinsockLib_IMSWinsockControlSendData (hSocket, NULL, varData);
 
Answer me. please.
 
Sorry..my english is not good.^^;
 
Best regard!
 
 
 
0 Kudos
Message 1 of 4
(3,292 Views)
Hi, jecki.

Can you tell me a little more about what happens when you call MSWinsockLib_IMSWinsockControlSendData ()? I don't really understand what is going wrong.

Have a nice evening!
Sarah K.
Search PME
National Instruments
0 Kudos
Message 2 of 4
(3,266 Views)

Hi Sarah.

1. variable(no problem)
int  i=10;
CA_VariantSetInt (&varData, 10);
MSWinsockLib_IMSWinsockControlSendData (hSocket, NULL, varData);
 
This(1) case a confirm to 'Data Arrival Event' commit to receiver system.
And, receiver system can get data.
 
2. 1D array(problem)
int  ia[10]={1,2,3,4,5,6,7,8,9,10};
CA_VariantSet1DArray (&varData, CAVT_INT, 10, ia); 
MSWinsockLib_IMSWinsockControlSendData (hSocket, NULL, varData);
 
This(2) case a not confirm to 'Dara Arrival Event' commit to receiver system.
And, receiver system can't get data.
 
regards.
Jecki.
0 Kudos
Message 3 of 4
(3,261 Views)
Hi, Jecki.

Those ActiveX wrappers can often be difficult to use; I recommend instead using some of the methods in the TCP or Datasocket libraries. (You can find them in the lower-left panel of CVI -- see screenshot.)




There are several examples of both of these libraries in the Example Finder. You can access them all by selecting Help>>Find Examples and then selecting Networking>>TCP or Networking>>Datasocket. The TCP examples MessageReader and MessageWriter are particularly nice and simple examples.

Let me know if you continue to have problems. Have a nice evening!

Message Edited by sarahk on 07-27-2006 07:15 PM

Sarah K.
Search PME
National Instruments
0 Kudos
Message 4 of 4
(3,242 Views)