LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

E-mail sendings hangs the compactrio

Solved!
Go to solution

Hi, 

 

I have a SBRIO which is supposed to acquire data and send e-mails in case of alarms.

 

As soon as the SMTP vis are runned, the compactrio hangs completely:

- I get the"Waiting for connection to target pop-up" when the system is trying to send an e-mail.

- CPU usage drops.

 

What can cause this behavior? Isn't a compactrio supposed to be able to send e-mail while doing something else?

 

best regards

 

peper

 

0 Kudos
Message 1 of 17
(3,128 Views)

Is it connected to a network or directly connected to your comp?

Which SMTP software package did you install on the sbRIO?

0 Kudos
Message 2 of 17
(3,122 Views)

The compactrio (sbrio) is connected to internet via a 3G modem.

 

I have the following packages intstalled:

SMTP Client 13.5.0

SMTP Client with SSL support 13.5.0

SSL support for Labiew RT 13.5.1

 

regards

0 Kudos
Message 3 of 17
(3,115 Views)

Do you have the necessary software components installed on the CompactRIO for sending email (SMTP or maybe it's part of some other software component)? If you're using TLS you might need the SSL libraries installed perhaps.

Are you specifying the SMTP server by IP address or DNS/domain name? If it's the latter, check you have a valid DNS server configured on the sbRIO.

 

You might want to see if you can find any error logs on the sbRIO that might indicate if there was an error or something. I would also try to run a simple VI on the sbRIO that just sends an email to see if it works in isolation.

 

I don't know the inner workings of the SMTP library that NI provides so it might be that sending the email will pause execution until the email is sent (which, as it uses TCP, could take an undetermined period of time) - you might want to do the sending of the email in a seperate loop to avoid hanging your application.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 17
(3,095 Views)

Thanks for your reply.

 

SMTP and SSL packages are installed.

 

The compactrio is configured with 10.127.13.150 as DNS and the server is specifyed with the DNS name. (10.127.13.150 is the 3g modem (gateway) wich itself is confifured to use the 8.8.8.8 DNS).

 

E-mail sending is already a parallel process in my application that's it's so weird everything gets locked up when an e-mail is being sent. 

I'll check if it's possible to make a small vi with TCP command that would replace the NI's vis.

 

regards

 

 

0 Kudos
Message 5 of 17
(3,083 Views)

FYI

 

I programmed a basic e-mail sending function using only the TCP IP primitives and it works very well without hanging the compactRIO.

So i guess there is something wrong with the SMTP packages NI is using.

 

Anyway, let's find a base64 encoding library now...

 

 

0 Kudos
Message 6 of 17
(3,053 Views)

I'm pretty sure there is a 'cryptography' library on the tools network which includes a Base64 encode/decode function.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 17
(3,048 Views)
Solution
Accepted by topic author peper2001

I had an issue in LabVIEW on a PC similar to yours.  LabVIEW would just hang while sending an email using the built-in functions.  NI never would confirm it was a bug, but I had used some code someone else posted to make it work.  The last message has the modified example code.  It probably is basically what you have already done.

0 Kudos
Message 8 of 17
(3,037 Views)

Thanks Matthew,

 

Indeed, I reprogrammed the basic SMTP function but your code implements a few extra function that I did not implement (like mail attachements). It might come in handy some day!

 

Regards

0 Kudos
Message 9 of 17
(3,018 Views)

Update.

 

FYI

 

It looks like trying to resolve a domain name also hangs the compactrio for several seconds. So if you specify the SMTP server by it's name and not it's IP address, and the compactRIO has no internet connection, you'll still get the freezing (even with the TCP IP primitives).

 

So I added a check where I try to open a TCP connection on port 53 of 8.8.8.8 to make sure I will be able to resolve the SMTP sever name.

 

peper

0 Kudos
Message 10 of 17
(3,001 Views)