LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send email from an RT controller

I use the following VI from the SMTP Email palette: SMTP Email Send Message (Small).vi.
I can use it from my computer without any problem
Now if I run this VI from a RT controller NI-PXI-7580 running:
- LabVIEW Real-Time 7.1
- NI-Watchdog 2.1.3
- NI-VISA Server 3.3.1
- NI-VISA 3.3.1
- NI-Serial RT 2.5.5
- NI-RIO RT 1.3.0 
- NI-DAQmx 8.0.0
I get this error:
Error 1 occurred at TCP Write in SMTP Email Send Message (Small).vi->TstSendEmail.vi
Possible reason(s):
LabVIEW:  An input parameter is invalid.
---
NI-488:  Command requires GPIB Controller to be Controller in Charge.
 
TCP IP is enabled on the controller, I had an application that could exchange TCP messages on that controller.
 
Anyone has an idea.  Could it be the network here that doesn't allow this RT to send email?
 
Thanks.
 
Patrick.
0 Kudos
Message 1 of 6
(5,755 Views)
Hi Patrick,

I hope you're doing well.  My first inclination was the say that not all functions that run in LabVIEW for Windows will run in the Real-Time Operating system because the Real-Time VIs are usually limited subset of the entire pallete, but the SMTP VIs use TCP, which I wouldn't think would be a problem.  If you drill down into the VI using the debug tools, is it apparant which "input parameter is invalid?"  It's possible that a network issue could block communication since SMTP uses a specific port, but I would think the error message would be different in that case.  The following KnowledgeBase talks about other issues that could cause the SMTP VIs to fail in general, but not specific to a Real-Time target.  If you try to do TCP communication on port 25, does this work correctly outside of the SMTP VIs?  I'm not sure that a PC would have more network access versus a Real-Time controller though, so if it works on a PC on the same network, this may not be the issue.  Let us know what you find!

Thaison V
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(5,708 Views)
Hi Thaison,
 
thanks for your reply.  The thing that makes me suspect that it could be a network access problem is that I'm working in a company where the network is very secured.  Not everyone has an internet access and we use Lotus Notes for emails!  Also all compters are scanned for not allowed software!  But back in the subject, our RT is in the lab subnet and I doubt that something on the network doesn't allow the RT to open such a socket.  From a previous project, I experienced the Error 1 with TCP Read and Write - that would be the result of an invalid TCP Connection ID. 
 
I'm not a TCP neither a network expert, but I'll try communication on port 25 (what's that port for?).  I know this RT can communicate on some user-defined ports (6881 to 6886).
 
I'll share my results when I'll have some time to work on that.  Thanks for your help!
 
Patrick.
0 Kudos
Message 3 of 6
(5,706 Views)
I just ran a quick test and was able to use the "SMTP Email Send Message (Small).vi" to send an email from an RT target. Since you can use it successfully from your Windows PC, I wouldn't suspect any problem with the VI that you are using or the SMTP server. So that would lead me to believe that it is a network or access problem. I'd agree with Thaison and recommend trying to simply open and close a TCP connection to the SMTP server on port 25. If that doesn't work, check to see if your RT target is on the same network (and subnet) as the Windows PC that worked. Then you'd probably have to check with your IT department to see if they would be blocking it.
 
-JR
0 Kudos
Message 4 of 6
(5,692 Views)


@pabr wrote:

thanks for your reply.  The thing that makes me suspect that it could be a network access problem is that I'm working in a company where the network is very secured.  Not everyone has an internet access and we use Lotus Notes for emails!  Also all compters are scanned for not allowed software!  But back in the subject, our RT is in the lab subnet and I doubt that something on the network doesn't allow the RT to open such a socket.  From a previous project, I experienced the Error 1 with TCP Read and Write - that would be the result of an invalid TCP Connection ID. 

Are you using the local PC and the RT controller on the same subnet. A router, gateway in between might be the issue.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 6
(5,667 Views)
I tried to open port 25 on the mail server from my RT and it failed.  So it is a network issue, IT will have to give accesses for the 20 RTs we have deployed in the field and in our lab!
 
Thanks to all for you help.
 
Patrick.
0 Kudos
Message 6 of 6
(5,661 Views)