LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I define type of data when I'm reading string via OPC server?

Hello!


I have system that you can see on attached picture.

The problem zone is marked red.

In best case I got "0x0000 0x0000" string.

I think I must correctly select type of data.

I tried STRING, ARRAYS of U8,I8,U16,I16 but without result.


How can I define type of data and get data?

Thanks.

0 Kudos
Message 1 of 7
(2,542 Views)

Where is your LabVIEW code?  There is nothing attached for people to see how you programmed this.

0 Kudos
Message 2 of 7
(2,529 Views)

Code is in the attachment.

0 Kudos
Message 3 of 7
(2,485 Views)

If you replace the numeric with a string and use the URL of this web-site, it would return the HTML for these discussion forums.

 

My point is you need to know what is on the other end associated with that URL to answer your question.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(2,483 Views)

When I read 10 holding registers directly via Modbus/RTU (without the OPC server), I get 10 U16 words.

They include the following information:

reg1/reg2         reg3/reg4            reg5/reg6          reg7/reg8        reg9/reg10

selected           measurement     measurement    min allowed    max allowed

physical unit     value of PMC1   status                 value              value

Pair reg3/reg4 has float value.

Quote from programmers guide (EPHUM011):

'You cannot read selectively the registers 3 and 4 for the measurement value only. You have to read the
entire length of the command (10 registers) and extract the desired information."

 

When I read the same data via OPC, I get "0000 0000 0000 0000".

When I open the window of the OPC server, I see the picture I attached.

I.e. OPC server successfully read data, and they have type "string" (string of what?)

 

Question is: may be should I request type of data from OPC server, and then read that data in right format?

And how can I do that?

0 Kudos
Message 5 of 7
(2,469 Views)

What output do you get if you don't specify the datatype at DataSocket Read? Or if you read it as a string? The data may be being parsed in a way that we're not expecting.

 

Nick

Applications Engineer

National Instruments

0 Kudos
Message 6 of 7
(2,454 Views)

I collected a lot of variants. Silly variants is here too.

I uploaded 2 pics for every variant: VI and output of VI.

I attache ZIP file because count of the attachment in this forum are limited.

First two variants show that I can read something from my OPC server.

Other variants show that I can read not all from my OPC server yet 😞

0 Kudos
Message 7 of 7
(2,440 Views)