Author Topic: Solution for Pi + mono AAHMI + ML1000 ??  (Read 6865 times)

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Solution for Pi + mono AAHMI + ML1000 ??
« on: January 17, 2017, 04:37:47 PM »
is there a solution to the Pi USB-Serial?. My app is very simple , just the serial driver with a basic label. I verified it works with PC, but not with Pi

1. I verified that USB-serial adapter is attached to /dev/ttyUSB0 with dmesg
Code: [Select]
pi@raspberrypi:~ $ dmesg | grep FTDI
[    2.115733] usb 1-1.4: Manufacturer: FTDI
[    5.043141] usbserial: USB Serial support registered for FTDI USB Serial Device
[    5.043434] ftdi_sio 1-1.4:1.0: FTDI USB Serial Device converter detected
[    5.044668] usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB0

2.  use Godra's mono GetSerial showed that it is /dev/ttyUSB0:
Code: [Select]
pi@raspberrypi:~ $ mono getserial.exe
/dev/ttyUSB0

3. Tried set access permission:
Code: [Select]
sudo chmod 777 /dev/ttyUSB0
4.  Tried set logical link with:
Code: [Select]
sudo ln -s /dev/ttyUSB0 COM1
5. Also tried adding this:
Code: [Select]
sudo nano /etc/modules   // use lsusb to see product id & vendor
sudo modprobe usbserial vendor=0x0403 product=0x6001
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #1 on: January 17, 2017, 05:38:15 PM »
Archie's reply #66 in other topic would suggest that there is no solution currently:

http://advancedhmi.com/forum/index.php?PHPSESSID=99891631c91bbc594fa6e3823662f2b5&topic=666.msg8053#msg8053


Vitor's experiment does show that it works with ethernet, as you already know that:

http://advancedhmi.com/forum/index.php?PHPSESSID=99891631c91bbc594fa6e3823662f2b5&topic=899.0

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #2 on: January 17, 2017, 06:00:48 PM »
http://www.benchforge.com/downloads/colt/colt_users_manual_02.pdf

The above link seemed to indicated that mono serial is possible , I think.

Vitor's experiment seemed to require an additional  PC.
Is it possible to first use Serial2net and set it to port 44818 instead, then in AAHMI, use driver like EthernetIPforSLCMicroCom1 or SerialDf1overTcpForSLCMicroCom1?

===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #3 on: January 17, 2017, 10:26:37 PM »
If you do have a Pi then you can always experiment with different options until you find one that works (your question might be your answer as well).

I currently don't have a Pi or a Linux computer to try anything.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #4 on: January 18, 2017, 02:09:23 PM »
Somehow, I knew you gonna say that, Godra. :=)

I am not even sure how to use the new driver SerialDf1overTcpForSLCMicroCom, wonder if Archie has a minute to explain this further
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #5 on: January 19, 2017, 12:05:55 PM »
I have some small success today. I am using version 399t.
Using ser2net , set its configuration to:
Code: [Select]
44818:raw:600:/dev/ttyUSB0:38400 8DATABITS NONE 1STOPBIT
In my AAHMI solution, I have one BasicLabel which pull a 1000ms (1 sec) value timer from ML1000.
I set SerialDf1overTcpForSLCMicroCom1 driver to have IP address: 127.0.0.1 and pollrate to 1000.

When I started the app, basiclabel would display  timer.acc value then stuck there for a while, meanwhile, I can see that TRX, RCV lights are going off/on. After a while, then values would changer per pollrate and lights are on/off evenly. It would run for a while ( few minutes) then crash.

Archie, do you have any suggestion here? see attached logfile
« Last Edit: January 19, 2017, 12:38:02 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #6 on: January 20, 2017, 12:49:22 PM »
I experienced the same behavior while using driver SerialDf1overTcpForSLCMicroCom1 & even though I ran it on PC.
That is value would come up, froze, then display per pollrate , eventually crashed.
or If I try to manually write to a bit,  worked a few times then crashed with error "No Response from PLC during Write"

Code: [Select]
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.


« Last Edit: October 25, 2017, 09:57:17 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #7 on: January 21, 2017, 11:03:22 AM »
Have you tried doing a test with the PLC attached directly to the PC (via USB2RS232 adapter if you are using it)?

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #8 on: January 21, 2017, 05:34:06 PM »
Yes, that was the first thing before I started to the Pi, using SerialDF1forSLC driver . Worked

Also tried

RaspberryPi ( Ser2net)  <---->   PC [ SerialToIPGUI as client, Com0Com, AAHMI with SerialDF1forSLC driver]. Worked very good.

and

RaspberryPi ( mono SerialToIP as server)  <---->   PC [ SerialToIPGUI as client, Com0Com, AAHMI with SerialDF1forSLC driver]. Worked amazingly stable.

I believed there is some bug in the SerialDf1overTcpForSLCMicroCom1 driver. It is a recently released driver.
« Last Edit: January 21, 2017, 06:11:52 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #9 on: January 21, 2017, 07:32:14 PM »
You can also try SerialDf1overTcpForSLCMicroCom1 without the Pi by using AHMI and SerialToIP server.

The setup should be similar to this:

  AHMI with SerialDf1overTcpForSLCMicroCom1 set to 127.0.0.1 and either 44818 or 8282 port
  SerialToIP server set to use either 44818 or 8282 port and USB2RS232 COM port

In a setup like this, the SerialToIP server should be frequently disconnecting/re-connecting and create a lag (but should still be working).
« Last Edit: January 21, 2017, 07:35:14 PM by Godra »

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #10 on: January 21, 2017, 08:30:14 PM »
I believed I tried that as well, but I will verify it on Monday.

1.  Pi ( ser2net, mono AAHMI with SerialDf1overTcpForSLC ) .                        ==> not reliable, crashed as described in previous post.
2.  Pi ( ser2net ) <------>  PC ( AAHMI with SerialDf1overTcpForSLC)                         ==> not reliable, crashed
3.  Pi ( mono serialtoip server ) <------>  PC ( AAHMI with SerialDf1overTcpForSLC)  ==> not reliable, crashed.
4. PC ( SerialToIPGUI server, AAHMI with SerialDf1overTcpForSLC )        will verify on Mon.

I just did some update & check mono version. it show version 4.6.2 (Stable 4.6.2.16/ac9e222 Tue Jan  3 12:12:14 UTC 2017), I  am hoping it will do some good for me :=)
« Last Edit: January 22, 2017, 08:50:49 AM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #11 on: January 21, 2017, 11:20:47 PM »
You could also try 1 more thing:

Run AHMI under mono on the Pi itself, with SerialDf1overTcpForSLCMicroCom1 set to 127.0.0.1 and 8282 port if you use SerialToIPGUI server or 44818 port if you are to use ser2net on the other end (meaning as the receiver for the packets).

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #12 on: January 22, 2017, 08:59:46 AM »
Do you mean like case #1? 

===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #13 on: January 22, 2017, 10:54:53 AM »
Yes, like that ... which leaves only SerialToIP server to try then.

This driver is more of experimental driver and I'm not sure if Archie would be looking to make any improvements to it.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Solution for Pi + mono AAHMI + ML1000 ??
« Reply #14 on: January 23, 2017, 01:04:51 PM »
4. PC ( SerialToIPGUI server, AAHMI with SerialDf1overTcpForSLC )   ==> BasicLabel display value, froze, then crashed. it certainly crashed immediately when writing a bit to PLC while it's disconnected.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================