LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasockets.

Hi,

Can someone point me to a datasocket tutorial, as opposed to the CVI
datasocket sample programmes.

I feel the need for an overview.

--
Thanks

John Cameron.
0 Kudos
Message 1 of 10
(4,821 Views)
0 Kudos
Message 2 of 10
(4,823 Views)

For some reason that link is not working for me...

I am trying to learn Measurement Studio (I believe we have 7.1) and I am using VB.Net 2003...

I am wanting to set up a very simple send/receive (a send textbox, send button, receive lable, and receive button) program using the datasocket over a LAN. I have the same program running on both computer, with the datasocket server on the computer where I have the target/source for the data. I have already set the URL (for the main computer it is dstp:\\localhost\data), and I have already used the DataSocket Server Manager to set the data item ("data") to allow multiple writers. But it is not working. If I "send" the data from one computer, the datasocket server acknowledges it, but I cannot receive the data from the other computer. I can only receive data that has been sent from the same computer... Are there any examples anywhere of how to do this? I checked on my harddrive, and the example there is useless for this type of problem...

Thank you!!!!

0 Kudos
Message 3 of 10
(4,592 Views)
Hi mrees515,

Have you tried having two writers and one reader on the same computer and notice the same behavior or does this only occur when having one of the writers and the reader on the client computer? The example that ships with Measurement Studio can test out what you are attempting to code by having one Writer on the server computer writing to localhost with the other Writer and the Reader on the client computer writing to dstp://hostname/wave.
Test Engineer - CTA
0 Kudos
Message 4 of 10
(4,563 Views)

Yes... the server on computer A sees the writer on computer A and the writer and the reader on computer B (all three)... but the reader on computer B only gets information from the writer on computer B... nothing from computer A... I've triple-checked the URL, and it all seems to be correct... Thank you again!

Marilyn

0 Kudos
Message 5 of 10
(4,553 Views)
Marilyn,

As Jon had suggested, have to tried having all on the same computer (both writers and the reader)? If so, does this work correctly? There are times where it could be a networking subnet issue and narrowing down if all work on the same machine would be the first troubleshooting step.

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 6 of 10
(4,512 Views)

I got the example program to run over the network the way Jon mentioned, but now I am trying to figure out how it works, and send text over Datasocket, not just Double or DateTime... Like send the text in sendTextBox when I hit sendButton, and the on the reader, show the text in a label when I hit receiveButton or something...

0 Kudos
Message 7 of 10
(4,498 Views)
Well with Visual Studio you should be able to call the write or read DataSocket functions on events if using WinForms (like when the button is pressed if that is one of your events). If you're using MFC (C++) then you would do it the same as any other user interface call and once that button is hit call those functions, grabbing the text from a textbox property (such as textBox.text or some other property).

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 8 of 10
(4,492 Views)

Ok, I started writing the program, and set it up exactly like the example, but in my program, when I add the thing from the example of

dataSocket.Data.Attributes.Add(.........)

I get this error message:

"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Additional information:

The value or attribute cannot be set because the CWData object is read only."

 

0 Kudos
Message 9 of 10
(4,470 Views)

Got it... I had it set programatically to accessmode.write, but apparently you have to set it in the properties window too...

Thanks!

0 Kudos
Message 10 of 10
(4,455 Views)