09-25-2020 08:47 AM
Hello Labview heroes,
I have a working C++ script for communication with a sensor over Ethernet with a DLL that I am trying to repeat in Labview.
This is a snippet of the functioning C++ code:
According to the forums, I need a callback library block:
From what I read, this should be the correct setting:
This does not work however and the VI almost crashes.
I have tried the other options as well but no luck.
Any help would be appreciated!
This is a link to the functions in the DLL: http://sch-remote.com/doc/SR01E12%20Library%20Functions.pdf
Best Regards,
Luc
Solved! Go to Solution.
09-25-2020 10:04 AM
From the manual:
SR_FUNC SR_HANDLE sr_open_eth(const char *ip, unsigned short port = 3101)
So you need a string and an unsigned short as an input.
So why does it work in C? Probably because they defined a default for the 2nd parameter in the header file.
09-29-2020 04:30 AM
Thanks a lot, that was indeed the problem!
05-12-2021 11:58 AM
Hi Luc:
will you please share how are you doing with the SR01E12 board? I am planning to use it
thanks
05-12-2021 02:50 PM
wiebe@CARYA wrote:
From the manual:
SR_FUNC SR_HANDLE sr_open_eth(const char *ip, unsigned short port = 3101)
So you need a string and an unsigned short as an input.
So why does it work in C? Probably because they defined a default for the 2nd parameter in the header file.
Actually default values for function parameters is a C++ feature. Standard C does not support that at all. The function declaration would be therefore a syntax error in all standard conforming standard C compilers. However some compilers nowadays are C++ compilers that are limited to standard C features by an optional parameter passed to the compiler command. So it is possible that some compilers might not choke on this despite compiling a *.c file as C file.
05-17-2021 02:56 AM
Hi Tecno,
So it took a long time, but I got it working in the end. For me it was difficult, but maybe if you are experienced with Labview, you will have it easier. The board itself is working fine. They are fragile though and should be handled with care.
Hope this answers your question and good luck.
05-17-2021 02:43 PM
Hi Luc1234:
Thanks for your reply, I am planning to use the i2c and GPIO’s, do you have any vi to share?
Thanks
05-18-2021 08:41 AM
I would like to, but it is company property, so sadly I cannot. Good luck!
05-18-2021 08:24 PM
Thanks anyway