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 - Noe

Pages: 1 ... 12 13 [14]
196
Open Discussion / Cross Threading Error
« on: December 03, 2013, 06:46:41 PM »
I had been programming for more than 6 months (and learning VB as this is my first contact with it) an application that uses AHMI to capture data and send database results to two PLC's (a Control Logix and a SLC 505). So far has been working really fine using v3.54, but this week has been a nightmare related to VB. I been getting an error message for "Cross-Threading operation not valid..." when trying to write or read labels from another thread. This is something I was not aware of, as never happened before and I just been reading for two days how to solve it, with little success. Too complicated for something simple like changing a text box content (text property) when a serial.datareceived event is triggered, that is to use a delegate method (still not quite getting how it works, but it works). See second method in here:
http://www.dreamincode.net/forums/blog/143/entry-2337-handling-the-dreaded-cross-thread-exception/

I have two questions for anybody who would help me before I loose all my hair:
1. This method solves the write issue, but not when you read. How can you do that?
2. If my application has lots of portions of code like this since day one, why did not happened before? This is what is more disturbing, as I been experimenting "changes" like this for one day to another that cannot be explained.

I already tested my previous versions to see if I changed something but all the previous versions do the same thing. Even took a new hard drive, installed everything from zero and tried again but getting to the same point, so I really do not understand why this is happening.

Any help will be really appreciated.

197
Support Questions / Re: AdvancedHMI Controls and Subscriptions
« on: October 29, 2013, 02:08:02 PM »
Well, I have same questions. I hope Archie could beam some light about subscriptions, like where we can find more information about.

198
Thanks Archie, I was trying out your suggestion when I stumbled with the answer: human factor.

Operator was pushing the reset button several times per second, as a result, it kept writing the variable from the PLC side several times (I used an OSR before the mov) and blocking to the VB to write its own value. Adding a TOF so even if the operator presses obsessively the reset button solved this, so only one time per second the value will be written, giving a chance to VB.

This was driving me nuts, as I could only see it happen when running in full auto, and as we have 3 simultaneous stations from this PLC it was hard to see every move from people.

So I think the value was being written from VB, but the PLC was still writing values as response to operator input, so it got quickly replaced and never seen.

I would believe the PLC sends an acknowledge to a write request, that if its not received, AHMI should send an alert, or at least that's what I understand.

199
Hi

I am using an integer value at PLC side as a way to define actions taken by PLC and VB app. Some values trigger actions as VB has an .onvaluechange event, and some trigger actions at the PLC.

Works like this:

A basiclabel reads the value on the integer variable at the PLC side.
Onchangevalue event will compare value and, if applicable, takes some actions.
If actions were taken, VB will write a new value (using a write command) to the same variable for the PLC to know it, and also reset it to an idle state or advance in logic.

Problem is that sometimes the integer value is not being written after the actions are finished at the VB side, like if the PLC would not accept the write command from AHMI.

Questions are:

Does this have to be with subscriptions working on basic labels and not with command write (that's is what I understood so far)? Like the read process is not finished when I try a write from code so the PLC ignores it. This happens only if I do it very quickly manually, changing the integer value at the PLC side a couple of times. In auto, it happens occasionally, like a 5% of the times I tried.

Is there another way to write values to PLC from AHMI that would be a warranty they will be written? I've seen Archie's post asking people about if they used code or just controls as this could be a cause.

Can some one point me to some information about subscriptions?


Any help will be gladly welcome, I am sorry if this has been discussed before, but I already searched the forum and couldn't find any similar information.

200
Support Questions / Re: Upgrading from 3.26 to 3.40
« on: August 14, 2013, 07:17:11 PM »
Archie

I'd been trying to upgrade from 3.26 (I think, someone erased version number...) to 3.40 or 3.41, which ever helps me with error reading I am having in my project. These usually are coming from reading a string from a SLC 5/05, by basic label I have not been able to. I was successful using a MessageDisplayByValue control, and taking its value from a string (strange but it works, but not every time). I added a similar control but is not reading anything.

Upgrading to 3.53 is not an option, as time is not on my side and the app got very complicated and full of controls to be ported in a short time.

All my attempts to do it, have been full of errors and I have nor been able to get the main form complete. Been adding existing items (.vb files, and modules), recreating a dataset, etc. but unlucky.

201
Thanks Archie. I will try again.

202
I just ran the default project,everything seems to be fine. I am not near to a PLC to test it, I just wanted to give it a try but ran into this screen that got my attention.

203
I do see the solution, and rebuild works fine. I just have an item in the solutions explorer as unavailable, the solution folder.

204
Hi Archie

First of all kudos for all your hard work, you are getting everybody to do things very hard to do in the past.

I just downloaded your recent 3.51 beta, but when opening VB says "Solutions folders are not supported in this version of the application error. Solution folder "Solution Items" will be displayed as unavailable.

Is this normal? I have VB Express 2010 and also 2008, in Windows 7 x86.

205
Support Questions / Re: Upgrading from 3.26 to 3.40
« on: July 19, 2013, 02:50:38 PM »
I will try it also, but coming from a lower version, do not know which one as my project was started by a college and does not know what version he used back in October. I think is a really early 3.0X version.

I had problems with some controls reading from SLC 5/05 and some other controls from CompactLogix (same VB app at the same time reads from both) as someone stated before (Error -20), I found some ways to go around them, not pretty, but worked out. Now I still have a problem, after a couple of hours running the app would freeze and the memory load on windows task manager will show that is consuming more than 500mb (is running on a Pentium 4, 512mb in ram PC). Stopping the process and starting the app would solve it. I believe is caused by some instruction filling all the available memory, so I want the update to check if it can solve it.

Just really started with visual basic, so please go easy on me.



Will report what happens then.

Pages: 1 ... 12 13 [14]