Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Error at Call Library Function Node: Warning: Connection to the target (RT CompactRIO Target) has been lost.

Solved!
Go to solution

Hello!

 

I did a cross compiled shared library from an AMQP C code example, and now I'm trying to call the functions from this .so to perform a "sendString" example on Labview using Call Library Fuction Nodes.

Everything appears to works fine, until I try to login into the server by "amqp_login" function. The labview stops and a warning message shows up.

 

warning.PNG

 

 

I looked into the amqp_login code and seems that it returns a Struct... 

 

amqp_rpc_reply_t AMQP_CALL amqp_login(amqp_connection_state_t state,
                                      char const *vhost, int channel_max,
                                      int frame_max, int heartbeat,
                                      amqp_sasl_method_enum sasl_method, ...);

 

typedef struct amqp_rpc_reply_t_ {
  amqp_response_type_enum reply_type; /**< the reply type:
                                       * - AMQP_RESPONSE_NORMAL - the RPC
                                       * completed successfully
                                       * - AMQP_RESPONSE_SERVER_EXCEPTION - the
                                       * broker returned
                                       *     an exception, check the reply field
                                       * - AMQP_RESPONSE_LIBRARY_EXCEPTION - the
                                       * library
                                       *    encountered an error, check the
                                       * library_error field
                                       */
  amqp_method_t reply; /**< in case of AMQP_RESPONSE_SERVER_EXCEPTION this
                        * field will be set to the method returned from the
                        * broker */
  int library_error;   /**< in case of AMQP_RESPONSE_LIBRARY_EXCEPTION this
                        *    field will be set to an error code. An error
                        *     string can be retrieved using amqp_error_string */
} amqp_rpc_reply_t;


amqp_login.png

I read something about CLFN can't return structs directly.

 

Is that the reason that Labview stops? Why this warning message shows up? How can I handle this structure on Call Library Function Node? 

Can anyone help me?

 

Thank you in advance!

0 Kudos
Message 1 of 3
(2,290 Views)

Hi Marcos,

 

Take a look at this link:

 

Can I Use External Code on My Real-Time System?

 

Looks like a .so file can only be used in a Linux-RT OS. Check if this is your case.

 

You can check this other link:

 

Unsupported LabVIEW Features on NI Linux Real-Time Targets

 

There are a list of unsupported features by NI Linux RT target.

A Call Library Function Nodes that access an operating system API other than NI Linux Real-Time is included.

 

I hope this could help you.

Isabelle Orlandi
Engenharia de Aplicações
National Instruments Brasil
0 Kudos
Message 2 of 3
(2,227 Views)
Solution
Accepted by topic author marcos_lvfoz

Thank you for the answer, but I solve this creating wrapper functions.

 

https://forums.ni.com/t5/NI-Linux-Real-Time-Documents/NIWeek-2017-Hands-On-Explore-C-C-Development-O...

Message 3 of 3
(2,178 Views)