LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC UA architecture

I've been meaning to try this code in CVI for a while.

The problem is with the line bellow and 4 more like it. It builds but gives you a general protection fail when run:-

 

namespaceArray->value.dataSource = (UA_DataSource) {.handle = server, .read = readNamespaces, .write = NULL};

 

If you alter the line to add an interim stage (all 5 instances) then it builds and runs perfectly.

 

UA_DataSource dtemp = {.handle = server, .read = readNamespaces, .write = NULL};

namespaceArray->value.dataSource = dtemp;

 

Hope this is some help.

 

Cheers

 

0 Kudos
Message 11 of 54
(3,968 Views)

Hi,

have u any update with the integration of open62541 into cvi 2015?

 

These days has come out cvi2017, there is a opcClient for UA connection?

 

thks

0 Kudos
Message 12 of 54
(3,882 Views)

Hi Kamillo

There seems to have been a new main release made within the last few weeks, so this should now work fine.

Previously you had to take one of the nightly builds as the bug fix to allow working with CVI2015 was not integrated.

 

I expect you will still need to make the changes I mentioned previously to get it to compile however.

 

Once I've checked out the new code I'll post to confirm if this is true.

 

Cheers

0 Kudos
Message 13 of 54
(3,856 Views)

The latest main release of open62541 (0.2) includes the fix needed to recompile with CLANG.

Since CVI uses CLANG, the sources can be compiled without errors in CVI (I didn't test yet with 0.2 release), but since this bug of CVI the usage of designated initializers produces a "general proteciton fault" during execution.

I don't see CAR 618185 as fixed in LabWindows/CVI 2017 Bug Fix Information.

 

As I already said, since CVI doesn't offer an OPC UA Library (and a JSON one, for example) I suggest that NI developers contribute to improve some open source libraries rather than develop proprietary solution.

I hope this will be the future, since I read that Ni and Open Source Software Go Hand-in-Hand

I suggest to CVI users to contribute to the development of the libraries, testing the integration into CVI and giving feedbacks to the development teams.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
Message 14 of 54
(3,843 Views)

Hi All

 

The bug that causes the general protection fault is with CVI not the open62541 code.

 

If you modify the open62541 code as bellow then it will build and there are no general protection faults when run.

 

Cheers

 

Find all 5 instances of the bellow line.

 

namespaceArray->value.dataSource = (UA_DataSource) {.handle = server, .read = readNamespaces, .write = NULL};

 

If you alter the line to add an interim stage (all 5 instances) then it builds and runs perfectly.

 

UA_DataSource dtemp = {.handle = server, .read = readNamespaces, .write = NULL};

namespaceArray->value.dataSource = dtemp;

 

Message 15 of 54
(3,838 Views)

Hello,

 
I'm using Open62541 to connect to SIEMENS CPU 1512SP.
I'm able to establish the connection using UA_Client_connect() but can't read any DataBlocksInstance.
I tried with UA_Client_readValueAttribute() but get always an error.
 
Any idea on how to read data from DataBlocksInstance?
 
In attachments the variable that i'm trying to read with the following code:
int main(int argc, char *argv[])
  { 
               
       UA_StatusCode retval;
      UA_Client *client = UA_Client_new(UA_ClientConfig_standard);
 
 
 
      retval = UA_Client_connect(client, "opc.tcp://192.168.11.240:4840");
 
    if(retval != UA_STATUSCODE_GOOD)
   {
      printf("no connection to OPC!!!");
   }
  else if(retval == UA_STATUSCODE_GOOD) 
  {
 
    UA_ReadRequest rReq;
   UA_ReadRequest_init(&rReq);
   rReq.nodesToRead = UA_Array_new(&UA_TYPES[UA_TYPES_READVALUEID], 2);;
   rReq.nodesToReadSize = 2;
 
  
    rReq.nodesToRead[0].nodeId = UA_NODEID_STRING_ALLOC(3, "Jimmy_DB.int_1");
   rReq.nodesToRead[0].attributeId = UA_ATTRIBUTEID_VALUE;
 
  
   UA_ReadResponse resp = UA_Client_Service_read(client, rReq);
  }
}
 
Thanks for your precoius help.
 
Regards,
Jimmy
0 Kudos
Message 16 of 54
(3,778 Views)

I'm developing a software that have to comunicate with OPC UA.

does this solution works?

Davide Vittorio G. - TLGB S.R.L.
Italian SW Developer
0 Kudos
Message 17 of 54
(3,367 Views)

Based on my tests, you can successfully compile 0.2 branch of open62541.

This is not the latest release of the library and it's not developed anymore.

 

You won't be able to compile the new 0.3 release  until NI updates Microsoft SDK to version 10 as requested here.

If you need this library, I ask you to give your kudo to the suggestion from Wolfgang.

I think the we, as users, should push NI a little bit more to develop CVI faster...

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 18 of 54
(3,365 Views)

Ok thank you, i will give a try.

Kudo given, i saw that there is also a toolkit but only for labview

Davide Vittorio G. - TLGB S.R.L.
Italian SW Developer
0 Kudos
Message 19 of 54
(3,362 Views)

i have tryed to import in my project the .h and .c file but i have some compilation error.

did you use this only 2 file or used the file in the example?

Davide Vittorio G. - TLGB S.R.L.
Italian SW Developer
0 Kudos
Message 20 of 54
(3,352 Views)