Download MetaTrader 5

Serial port communication - page 2

To add comments, please log in or register
Demos Stogios
Demos Stogios  

Hello, a couple of thoughts by me

a. Certainly a good idea to use microcontrollers; but how about outputing to GSM? Maybe you should consider using a cheap smartphone with Android and  evaluate what are the options using USB and the Android NDK. Or maybe Firefox OS. In that case, using an also cheap mobile data plan it may even be possible to use the phone as a backup internet provider; which brings us to b.

b. Maybe a VPS or a dedicated line (aka T3) is all we need as a simple home internet connection is not an ideal place for a trade environment; I was speeking with a technician about some disconnections tha happen from time to time, and he said that normal conditions are considered 4 disconnections per day

 c. you may try to ping regurarly a server and use a company that offers web SMS  services along with an API

rubengarber: The Win32 API were my first idea with "Importing Function (#import)", but  MQL4 not recognize "HANDLE hComm;"and I locked
Of course it doesn't, HANDLE isn't part of MT4. What is the definition of your HANDLE? then define it in MT4
#define HANDLE int // 32 bit opaque
#import ...
You must translate everything necessary. Like I did for a pre-build 600 TimeGMT() function:
#import "kernel32.dll"
int    GetTimeZoneInformation(int& TZInfoArray[]);
datetime LocalTimeToUTC(){   // TimeLocal to GMT
   // This is called only by TimeGMT. Check for IsDLLsAllowed() done there.
   int      TZInfoArray[43];
   int      tz = GetTimeZoneInformation(TZInfoArray);
   int      GMTshift = TZInfoArray[0]; // GetTimeZoneInformation will return
   #define TIME_ZONE_ID_DAYLIGHT 2     // the right Bias even when it returns
   #define TIME_ZONE_ID_UNKNOWN  0     // UNKNOWN
      GMTshift += TZInfoArray[42];
   return (TimeLocal() + GMTshift*60);
// typedef struct _TIME_ZONE_INFORMATION {      typedef struct _SYSTEMTIME {
// LONG        Bias;           [ 0]  (min)   WORD wYear;       [0]
// WCHAR       StandardName[32];  [ 1]       WORD wMonth;            Jan=1
// SYSTEMTIME  StandardDate;      [17]       WORD wDayOfWeek;  [1]   Sun=1
// LONG        StandardBias;      [21]       WORD wDay;
// WCHAR       DaylightName[32];  [22]       WORD wHour;       [2]
// SYSTEMTIME  DaylightDate;      [38]       WORD wMinute;
// LONG        DaylightBias;      [42]       WORD wSecond;     [3]
//                                   }       WORD wMilliseconds;              }
Thanks for every ideas.

I thought in a microcontroller because I want to monitor the power supply failure to UPS(Uninterrunped Power System) before the batteries die and switch off  the PC and the Routter
To add comments, please log in or register