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.


Messages - paintman

Pages: [1] 2
1
Will the e.Value always remain as e.Value(0) or will it move to e.Value(1) in correspondence with the member values?

2
So, I specified the PLCAddress on the the PLCAddressValueItems for each member. Will I need to define that in the code as well?

If so would it just be the same structure just like this?

Code: [Select]
        If e.PLCAddres = "B18:0/1" Then
            shutcut.Value = initial0 + 1
        End If

I was hoping to be able to check each individual member for a T/F statement to add the values

3
Support Questions / Re: Extra colors on basicindicator
« on: June 27, 2024, 03:19:06 PM »
Yes it is, you can modify the color of the indicator directly using basicindicator#.color# = color.<insert color>

4
Support Questions / Checking different members of a datasubscriber
« on: June 27, 2024, 03:06:33 PM »
Hello,
I am using Datasubcriber2 to check 8 different bits, but i think i may be calling the values wrong. Other examples i have seen are only calling on one bit at a time.
This is a snippet of my code:
Code: [Select]
        If e.Values(0) = True Then
            shutcut.Value = initial0 + 1
        End If
        If e.Values(1) = True Then
            sc_call.Value = initial1 + 1
        End If
        If e.Values(2) = True Then
            boxpos.Value = initial2 + 1
        End If
        If e.Values(3) = True Then
            boxblock.Value = initial3 + 1
        End If
        If e.Values(4) = True Then
            loomguard.Value = initial4 + 1
        End If
        If e.Values(5) = True Then
            mispick.Value = initial5 + 1
        End If
        If e.Values(6) = True Then
            patalarm.Value = initial6 + 1
        End If
        If e.Values(7) = True Then
            tension.Value = initial7 + 1
        End If

The error i get is for e.Values(1), which says 'Index was out of range. Must be non-negative and less than the size of the collection.' but i cam calling member 1 of the datasubscriber right?

I may be doing this wrong, which is why i am asking.

5
Not sure if there is a way to do this, but I was curious if it was possible to be able to download the tag list itself.
I am currently working on a project which would be used for AB/Omron/Siemens to integrate fastec as a data monitoring system. The only problem is these machines are proprietary and I am unable to look at the tag names to reference them using AHMI, so I was hoping there would be a way to pull the tag names themselves into say a text document or a spreadsheet.

Does anyone have any ideas?

6
UPDATE: I had to uncheck the debugger to not break when this exception was thrown 😅 my bad... Thank y'all it works perfectly!!

7
I tried it with the NativeMethods you attached but I am still getting this error:
Quote
Managed Debugging Assistant 'PInvokeStackImbalance'
  Message=Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'AdvancedHMI!MfgControl.AdvancedHMI.NativeMethods::OpenPrinter' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'

Could this just be a formatting issue with the form I am using to create the string that will be placed on the label?

8
So I tried using the NativeMethods.VB from the link that was given which fixed the "Friend" issue. However now its throwing an exception saying:
Code: [Select]
MfgControl.AdvancedHMI.NativeMethods::OpenPrinter' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'
Which I have no idea what that means...

9
I have plugged everything in, but I am getting an error for the NativeMethods portion.

It is showing that the method isn't accessible because it is a "Friend" though the whole sub is public and its namespace is being imported.

And is the .pDocName suppose to be the name of the format file?

10
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.

11
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

12
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*

13
Support Questions / Re: How to Avoid PLC and PC timeouts
« on: April 02, 2024, 12:58:56 PM »
Hey Archie, I know this is an old thread but I had to take a step back for other projects.

I don't think I fully understand the way the elements, plcaddressitems, and e.values would work. Does e.values report single values based on the elements?
So we have 85 carriers on our line that pass through a scanner to tell us which one it is (they are not in order)
So in my code it would be Carrier_Info[Stop_1.Carrier_Number] as the main tag and then the elements follow would be paint_color, name, oven_cycle and so on.

So would I need to just define 85 plcaddress items each with 8 elements and then still use the carrier number variable to define the e.value?

14
Support Questions / Re: How to Avoid PLC and PC timeouts
« on: February 29, 2024, 11:18:57 AM »
Awesome, for my situation with the array, it may be Paintpart[23] and the associated elements, or [65] depending on the carrier number at the station. With the data subscriber it looks like I can only call specific tags and not have a variablized tag. Would I need to just call the base name Paintpart then specific the actual tag location later in the code?

ps sorry for asking so many questions

15
Support Questions / Re: How to Avoid PLC and PC timeouts
« on: February 29, 2024, 10:02:39 AM »
Does the datasubscriber work for multiple PLC tags or is it for a single tag per subscriber? Currently the most important one I am trying to read is an array of tags with 8 elements to each tag.

Or would it be best to just setup the data subscriber to read the stop release bit and then run the full sequence of code?

Also does the datasubscriber read two way changes? Like if the bit changes from 0 to 1 it runs the sequence then when it changes back from 1 to 0 it reads again?

Pages: [1] 2