Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bachphi

Pages: 1 2 [3] 4 5 6
31
Open Discussion / Creating PDF report
« on: March 13, 2019, 05:33:41 PM »
Hello,

Anyone here with experience of how to create a PDF report?  including insert a couple pictures that was saved/ftped from Cognex camera.

TIA.

32
Open Discussion / Communication Distance Limits (2)
« on: February 25, 2019, 11:31:09 AM »
DavidSr,

Interesting topic, good to know. I do have a question: You said you ran a POE camera WITHOUT an injector? how does the camera get its power?

As for serial distance limit of 50FT. It's interesting that you can run up to 250 ft. However, It's not surprised that you can run longer than 50 ft with CAT5 cable , since they are twisted pair and therefore its capacitance is reduced, but I thought it should max out at 147FT.

CAT7  cable should theoretically give a max at 2500/0.36 = 6,944 ft.






33
Feature Request / BasicButton with ImageON and ImageOFF
« on: February 24, 2019, 01:37:50 PM »
Currently, in order to show ImageON & OFF with BasicButton, some coding will be required presumably.
But if there's a large number of buttons, then coding can become messy. Yes, one can combine all button click type events into one routine, but things get more complicated with using different color like ImageGreenON or ImageRedOFF or ImageYellowON or ImageBlueOFF and etc ...

Any ideas? Thanks.

34
Open Discussion / Selector Switch control with Muti-line Text
« on: February 13, 2019, 08:01:54 PM »
In order to make text appear in 2 lines , I have to play with spaces, would it be better with multi line text? what do you think?

35
Open Discussion / Seeking some food for thought
« on: January 25, 2019, 09:14:50 PM »
I have a mix of machines that I want to monitor its uptime/idle status and such. Since they are mix, I am thinking of adding some photoeyes to detect their output/running status, connect them to a PLC. Then use AAHMI to display a screen showing status of each machine, display production counts, maybe green color for running,  or yellow for not seeing activity more than 30 min, red  for more than 1 hour .... then perhaps send to .

If you can share some thoughts, I will be greatly appreciative!

36
As of 1/2/19

For windows XP, version 20.04 can be installed. It does include some module Addon Profile from Cognex, Endress+Hauser, Parker Hannifin, Reliance Electric, BUT not SMC, Zebra.

For windows 7/10, version 20.05 can be installed. It does include some  AOP from SMC, Zebra BUT not Cognex. AOP from Cognex need to be downloaded and install manually.

37
Open Discussion / New year, new looking website
« on: January 01, 2019, 08:21:56 AM »
Hey it's new year and I appreciate Archie taking the bold initiative  to change the website !!

I think the background color and font type that you had before is nicer and make it easier to read and follow.

38
Open Discussion / .NET interface directly to Cognex
« on: November 28, 2018, 04:55:37 PM »
I plan to use a cognex Dataman DMR260 and  a IS2000M without a PLC, just PC with .NET using their SDK.
Anybody here with experience using their SDK? TIA.

39
Open Discussion / Daylight Saving Time with ML1400
« on: November 05, 2018, 01:48:42 PM »
Would you have any ideas how to implement a Daylight Saving time in ML1400? 
I currently use the Set Date & Time button to set it to the correct time.

TIA



My idea, .NET PC will generate DST event , then PC will write to PLC to change its time:

Code: [Select]
S:37 0 Clock Calendar Year
S:38 0 Clock Calendar Month
S:39 0 Clock Calendar Day
S:40 0 Clock Calendar Hours
S:41 0 Clock Calendar Minutes
S:42 0 Clock Calendar Seconds
S:43 0 STI Interrupt Time
S:44 0 I/O Event Interrupt Time
S:45 0 DII Interrupt Time
S:46 0 Discrete Input Interrupt-


I was able to change the hour as a test:




40
Open Discussion / convert string to float/double array
« on: October 29, 2018, 08:19:16 PM »
I have some serial data string that have format like the s string below. Using some AnalogValueDisplay meters and some vb code, I was able to display them properly
Code: [Select]
Dim s As String = "0.5969675993919372, 2268826624, 1.391914329528809, 654071936" + vbCrLf
        s = s.Replace(vbCrLf, String.Empty)
        Dim sa() As String = s.Split(","c)
        AnalogValueDisplay1.Value = Format(CDbl(sa(0)), "0.000")
        AnalogValueDisplay2.Value = Format(CDbl(sa(1)) / 1000000, "0000")
        AnalogValueDisplay3.Value = Format(CDbl(sa(2)), "0.000")
        AnalogValueDisplay4.Value = Format(CDbl(sa(3)) / 1000000, "0000")
But, C# side have some cool way to convert it directly to float array, I tried to convert to vb format but keep getting error for it:

Code: [Select]
double[] doubles = sarray.Split(',').Select(Double.Parse).ToArray();

Array.ConvertAll(sarray.Split(','), Double.Parse);
double[] doubles = Array.ConvertAll(sarray.split(','), new Converter<string, double>(Double.Parse));

Thanks in advance.

41
Open Discussion / Serial Communication , a neat trick
« on: October 21, 2018, 01:53:18 PM »
I came across this article with a neat trick, I thought I would share with you:
https://www.codemag.com/article/0611061/Fun-with-RFID


The RFID reader send 12-byte datagram with a format that looks like :
<LF>123456789A<CR>

Since serial devices send their datagram in more than one blocks, his neat trick was
using a TextBox control (with the Multiline property set to True), then append all data until
the last line is an empty string. then data( TagID) is in the second to the last line.
To check for this condition, he use the Text changed event.

Code: [Select]
Public Class Form1

    Private WithEvents serialPort As New IO.Ports.SerialPort
    Private tagID As String = String.Empty
    Private timeRecorded As DateTime = Now
    Const COM As String = "COM3"
    Const FILE_NAME As String = "C:\Attendance.csv"
    Const INTERVAL As Integer = 3

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Timer1.Interval = INTERVAL * 1000
        If serialPort.IsOpen Then
            serialPort.Close()
        End If
        Try
            With serialPort
                .PortName = COM
                .BaudRate = 2400
                .Parity = IO.Ports.Parity.None
                .DataBits = 8
                .StopBits = IO.Ports.StopBits.One
                .Handshake = IO.Ports.Handshake.None
            End With

            serialPort.Open()

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub

    Private Sub DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles serialPort.DataReceived

        txtTagID.BeginInvoke(New myDelegate(AddressOf updateTextBox), New Object() {})

    End Sub

    Public Delegate Sub myDelegate()
    Public Sub updateTextBox()
        ' for receiving plain ASCII text
        With txtTagID
            .AppendText(serialPort.ReadExisting)
            .ScrollToCaret()
        End With
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

    End Sub

    Private Sub txtTagID_TextChanged(sender As Object, e As EventArgs) Handles txtTagID.TextChanged
        If txtTagID.Lines(txtTagID.Lines.Length - 1) = String.Empty Then
            Dim temptagID As String = txtTagID.Lines(txtTagID.Lines.Length - 2)

            Dim tp As TimeSpan = Now.Subtract(timeRecorded)
            Dim timeInterval As Double = tp.Ticks / TimeSpan.TicksPerSecond

            If (temptagID = tagID) And timeInterval < INTERVAL Then
                Exit Sub
            End If

            tagID = temptagID

            timeRecorded = Now
        End If
    End Sub

    Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
        serialPort.Close()
    End Sub
End Class


42
Support Questions / PilotLight3Color problem
« on: October 15, 2018, 10:37:50 AM »
I am using v399yBeta12.
I have a working PilotLight3Color w/ settings:

PLCaddressSelectColor2  B3:6/2
PLCaddressSelectColor3  B3:6/3

Everything is Working up to this point.

As soon as I add a Basic Label w/ PLCAddressVisible = B3:0/x    will make my PilotLight flashing RED. Anyother other address like B3:1/0 will work fine

43
Open Discussion / Using MessageDisplayByValue to print Failcode label
« on: October 10, 2018, 04:04:11 PM »
I have a working MessageDisplayByValue1 which uses an inifile 'alarms.txt', the text message is displayed based on PLC value.
Since its lengthy text can not fit the label, I resorted to create another MessageDisplayByValue2
which uses the same PLC value but different inifile 'FailCodes.txt' with much shorter description( see below):

1,M25 LV -
2,M25 HV -
3,M25 LV HV - M24 LV

and some codes to print the fail label:
Code: [Select]
        Dim s As String() = MessageDisplayByValue2.Text.Split("-"c)
        Dim fail1 As String = s(0)
        Dim fail2 As String = s(1)
        ZPL_STRING = ZPL_FAIL       'copy fail label code to ZPL string
        ZPL_STRING = ZPL_STRING.Replace("[FailReason1]", fail1)
        ZPL_STRING = ZPL_STRING.Replace("[FailReason2]", fail2)

        SendZplOverTcp(ZebraAddress)


I'd like to avoid using MessageDisplayByValue2, use only FailCodex.txt and pass the string based on PLC value of MessageDisplayByValue1.
I tried to use KeyValuePair , but have not been able to sort it out yet:

Code: [Select]
Dim lines() As String = System.IO.File.ReadAllLines(".\FailCodes.txt")
Dim list As List(Of KeyValuePair(Of Integer, String)) = New List(Of KeyValuePair(Of Integer, String)
   

Thanks in advance.

44
Open Discussion / Florence
« on: September 11, 2018, 08:55:52 PM »
Are you being affected by Florence? 
 Hope that it will not do too much damage

45
Open Discussion / Hot rumor in case you missed it
« on: August 21, 2018, 09:00:42 PM »
and while Archie is on  vacation.  :)
Orangeburg, SC - In a latest conference call with some boring and uncool analysts,
Elon M. expressed his fully desire to bring his TESLA company from public traded to a 'private entity'.
There is also a strong possibility that Manufacturing Automation company which is AdvancedHMI's parent company, will be brought in to help increase the model 3 production rate to the tent's roof.
Rockwell executives are now paying more attention to this rare news and hence has been scrambling to salvage their most important deal of the year, and in so doing heating up a brutal bidding trade war.
In other Fool news of Aup'ril, Beta 13 will be available as the last free version to be offered to the general public.




Pages: 1 2 [3] 4 5 6