News:

  • May 17, 2024, 08:26:22 AM

Login with username, password and session length

Author Topic: Domore logging  (Read 2415 times)

amos

  • Full Member
  • ***
  • Posts: 39
Domore logging
« on: December 22, 2017, 12:12:56 AM »
I have this application where I use the Domore logger to log some data to a file. If I wanted to log to a file without using the logger how would I go about doing that? Also is it possible to log to a database like access? It seems that it should be possible. Is there an example somewhere? Or even a ftp server. Any help would be really appreciated.
     
amos

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: Domore logging
« Reply #1 on: December 22, 2017, 10:04:28 AM »
There are a number of options.

We have the source code of DmLogger available to you in both C++ and C# form.  You can look at the source and either tweak it to your needs, or just see how it works and write your own code around WinSock.  You can utilize your own TCP port instead of the 0x7272 port that uses broadcasts - if you do that, you would need to utilize TCPOPEN and STREAMOUT to your own Do-more TCP device (instead of @DmLogger in STREAMOUT).  This is easy to do in Designer's System Configuration dialog (we can show you how if you go this route).  Let us know if you would like a copy of the source code (it's free).

If you are not a developer, but want to utilize an existing application, Automation Direct has a software product called DataWorx:
DataWorx PLC data logging software makes it easy for your PC or file server to collect data from your Ethernet-enabled PLC without the need for special PC programming or any third party HMI, SCADA, or DAQ software application. Packages with connections to a single PLC system or unlimited PLC systems are available.
« Last Edit: December 22, 2017, 10:05:59 AM by franji1 »

amos

  • Full Member
  • ***
  • Posts: 39
Re: Domore logging
« Reply #2 on: December 22, 2017, 04:17:38 PM »
I guess that would work. I guess 1 issue is sometimes the logger get switch off. Any utility would have the same problem. I read html connections to databases also IIS. I've played around a bit using Telnet but I have no clue how to connect to any FTP or database.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: Domore logging
« Reply #3 on: December 22, 2017, 04:26:55 PM »
I would search the forum for similar questions.

If you are already familiar with how to interface with databases, PLC Nut has a few examples for reading or writing to databases using Do-more.

plcnut

  • Hero Member
  • *****
  • Posts: 803
    • premiersi.com
Re: Domore logging
« Reply #4 on: December 22, 2017, 07:35:07 PM »
If you are familiar with IIS and some .net coding, then you could set up a server to do it.
Otherwise you could build a simple .net app that runs as a service that will listen on a TCP port and log for you.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

amos

  • Full Member
  • ***
  • Posts: 39
Re: Domore logging
« Reply #5 on: December 23, 2017, 12:31:18 AM »
Thank you franji1 and plcnut

   
Quote
"Otherwise you could build a simple .net app that runs as a service that will listen on a TCP port and log for you.
Where would you suggest i would find some information on the subject? Is there an example somewhere? I've  read a bit on the subject but it seems to fall short of what i'm trying to do.   Any help is appreciated.
      Thank You      amos   

amos

  • Full Member
  • ***
  • Posts: 39
Re: Domore logging
« Reply #6 on: December 27, 2017, 11:42:34 PM »
Here is a little bit of nothing that listens to the domore logger and logs to a file. This was written in Python3


from socket import *

Ip_Address = '0.0.0.0'
Port_Number =29298


Connection = socket(AF_INET, SOCK_DGRAM)
Connection.bind((Ip_Address,Port_Number))   #ip address and port number


while (True):
    Data,IpAddress=Connection.recvfrom(1024)
    print (Data,"     ",IpAddress[0])

    Myfile = open("log.txt","a+")
    Myfile.write(" %s\r\n" %Data)
    Myfile.close()