Recent Posts

Pages: [1] 2 3 ... 10
1
Okay that seems fairly simple. The rawprinterhelper is a tad confusing for me.

Is the rawprinterhelper just placed in a separate module and called when needed? I am looking at the class and trying to understand some segments of the code. 
Would I just change this to what ever I name the ZPL file as, and the data type I assume would remain the same since its send a direct ZPL file?
Code: [Select]
        ' Set up the DOCINFO structure.
        With di
            .pDocName = "Mix Room Label Printer"
            .pDataType = "RAW"
        End With

And as far as the printer name goes, I figure it wouldn't really matter as long as it is the default.
2
Open Discussion / Wago Modbus
« Last post by smoreno on Today at 12:26:47 PM »
Hello
I am new this software, I think it works good,
I have some isseu addressing modbus to wago plc, has some one done any communication on this brand
tha can help out,
thanks in advance
3
After creating the file using the Zebra designer software, I manually edited with Notepad. Attached is the file.

The first thing my code does is to read data from the PLC and put it in a local variable:
Code: [Select]
        Dim RecipeName As String = ""
        Try
            RecipeName = EthernetIPforCLXCom1.Read("Batch1RecipeName")
        Catch ex As Exception
            MsgBox("Failed to read Batch1RecipeName from PLC. " & ex.Message)
            Exit Sub
        End Try

It then reads the file and stores it in a string:
Code: [Select]
        Dim s As String
        Using sw As New System.IO.StreamReader("BatchTicketLabelFormat.prn")
            s = sw.ReadToEnd()
        End Using

Using Regular Expression, the string is parsed looking for the brackets
Code: [Select]
        Dim x As System.Text.RegularExpressions.Match = System.Text.RegularExpressions.Regex.Match(s, "\[(.*?)\]")
        Dim Substitue As String
        While Not String.IsNullOrEmpty(x.Value)
            If x.Value.IndexOf("Batch1RecipeName") >= 0 Then
                Substitue = RecipeName
             Else
                Substitue = "ZZZZZZ"
            End If
            s = s.Substring(0, x.Index) & Substitue & s.Substring(x.Index + x.Length)
            x = System.Text.RegularExpressions.Regex.Match(s, "\[(.*?)\]")
        End While

And finally send the string directly to the printr:
Code: [Select]
        RawPrinterHelper.SendStringToPrinter(RawPrinterHelper.DefaultPrinterName(), s)
4
I think I found a thread on plctalk refering to the project you mentioned. It said you used brackets [] as the container to look for in the zpl, but how did you get the bracket in to the file? Did you just prefill the text with [Variable] and then just replaced the inner string, or you just altered the actual zpl file?

I am very interested on seeing the code for this, I am not well versed on printer communications nor how I can link it to AHMI
5
Support Questions / Re: Graphic indicator
« Last post by Archie on May 08, 2024, 05:36:24 PM »
This should work. What version of AdvancedHMI are you using?
6
Support Questions / Re: Exit Button on MainMenu
« Last post by Archie on May 08, 2024, 05:35:32 PM »
You are correct, the MainMenu does need to use MainMenuButtons instead of form change buttons.

The MainMenu form has a property of MenuPosition. Depending on whether the form is taller than wide or vice versa is what determines the edge it will dock to.
7
Support Questions / Re: Second monitor
« Last post by Archie on May 08, 2024, 05:32:14 PM »
It has been a long time since I have done this, but you need to create another form, show it, then dock it onto the second monitor. I would have to search for the code to remember how to dock the form onto the second monitor
8
Support Questions / Re: AdvancedHMI not correct .NET framework for nugget.
« Last post by Archie on May 08, 2024, 05:29:36 PM »
Several years ago I did a project that needed to print to a Zebra label printer. I installed the printer driver into Windows and set the zebra as the default printer. From there I send a raw string of data directly to the printer that was in the ZPL format.

Attached is a helper class I used for sending the data to the printer.

The code to send a string to the printer using the helper class:
Code: [Select]
        RawPrinterHelper.SendStringToPrinter(RawPrinterHelper.DefaultPrinterName(), s)

I created a label using the Zebra software and saved it to be used as a template file. I then edited the label file to insert markers where I wanted to substitute data from the PLC. For example, [BatchNumber]

I wrote code to read that template, searched for the markers, then substituted the real data. And finally sending the string directly to the printer.

I can share more of the code, if you are interested
9
Support Questions / AdvancedHMI not correct .NET framework for nugget.
« Last post by paintman on May 08, 2024, 04:41:45 PM »
Is there a way to add AdvancedHMI to a project or does it have to be started using the blank project? Reason being, I am trying to add a Zebra nugget package to a project and keep getting these errors:
Quote
  CACHE https://api.nuget.org/v3/registration5-gz-semver2/zebra.printer.sdk/index.json
Resolved actions to install package 'Zebra.Printer.SDK.3.0.3271'
Install failed. Rolling back...
Package 'Zebra.Printer.SDK.3.0.3271' does not exist in project 'AdvancedHMI'
Package 'Zebra.Printer.SDK.3.0.3271' does not exist in folder 'C:\Users\ashquinn\Desktop\PrintTest\packages'
Executing nuget actions took 1.18 sec
Could not install package 'Zebra.Printer.SDK 3.0.3271'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Time Elapsed: 00:00:01.8759248
========== Finished ==========

I am not sure how to get around this, or if there is even a way to. I am trying to print a tag element from my PLC to a Zebra zt410/411 without using the PLC. I was opting for VB to be in control. Has anyone one worked on something similiar to this?

*Edited title to be more accurate*
10
Support Questions / Re: Only reading 1 array register
« Last post by dmroeder on May 07, 2024, 10:06:57 AM »
Thanks for the update FlippinBits.

This is a very interesting issue. There have been issues in v32+ where some corruption of the tag database occurs.  The result ends up being you cannot upload the program from the controller.  Only recourse is to download.  We've seen this a couple of times, luckily for us, it's just machines we are building, not in production environment.

Seems like a similar issue.  Curious, are these tags UDT members?  I think Rockwell has opened up some UDT editing (renaming maybe?) online, there are technotes about corruption happening in when doing this in some versions.  What firmware version are you using?
Pages: [1] 2 3 ... 10