WaitOne while I introduce multithreading

For some time I've been meaning to do some multi threading in the Dynamics SOP Fulfilment software I wrote. I have always thought that I could make things run a little more slickly. At fulfilment the following processes occur;

  • Credit/debit card debited if one is attached to the order
  • Order lines are fulfilled by quantities on the pick list being fulfilled
  • receipt printed (optional depending on carriage option- customer collect etc)
  • despatch note printed (optional)
  • invoice printed (optional)
  • thermal parcel label(s) printed one for each parcel entered
  • consignment details are exported via XML to UPS / Business Post / TNT depending on carriage routing algorithm
  • UI is constantly updated with progress bar and messages about progress

Spinning the fulfilment thread off on to its own thread using a background worker control was straight forward and is something I did when VS2005 was released. However some of the above processes take quite a few seconds to run, the fulfilment computers are quite recent hardware and thus should be able to perform better.
Thanks to good object orientated design, it turned out to be fairly trivial to get each of these processes to run on their own thread and synchronise them using wait handles. I had to use wait handles as some tasks depend on the successful completion of others. More...

Zebra Thermal Label Printing using VB.NET

Many, years ago (2001) I wrote a small application in Delphi that would allow a user to print thermal labels to a Zebra or Eltron EPL or ZPL language printer. It also supported printing to dotmatrix labels. That shows how long ago it must have been.
the labels were based on information drawn out of Dynamics GP. Thus warehouse bin location, item description etc was pulled through from GP allowing the goods in department to quickly print off labels for goods they were bagging or stocking.
As we have recently added another company to our premesis it is now desireable for the application to automatically detect which company the part number entered belongs to and print a label with the correct layout for that company out. The applicaiton originally written in Delphi is overdue for a rewrite into .NET.

Original Delphi Dynamics GP Thermal label software

There was no hours available in work time to write this applicaiton so I took it home to write in the evenings. The following posts show you how I got on. I had, as usual forgotten about some of the nice features I had encorporated into the original application.

Part II to follow....

Parent Swap @ Cedar Point & Kings Island

 Cedar Point Skyline from Marblehead

Parent Swap IconI have been wanting to get to Cedar Point, Ohio for about ten years, I followed the construction of Millennium Force through the snow of winter using the internet, via the Cedar Point Diary found on the Cedar Point website. I call it diary as it was before the term blogs emerged. We finally got over there this summer, we got to take in Canada’s Wonderland in Toronto and Kings Island, Cincinnati on the trip too. As we were travelling with a five year old I was delighted to find out that Cedar Point and Kings Island were both running a Parent Swap scheme. I will explain for those of you making the transition from visiting theme parks without kids and who now find you have small feet following you around the park. These schemes make the difference between an adrenalin filled amazing experience riding all the big rides and getting on a couple or rides and everyone falling out causing the day to prematurely end. The problem visiting the parks is that only the adults can ride the many of the rides due to safety height restrictions. Kids get bored easily and when they do they turn on you, making life a misery. You quickly find that if your young child has to wait outside each ride for forty or more minutes while both the parents go on the ride, the day will plummet quickly. The other important point is that having paid the admittance fee at the gate you want to all get the most out of every hour at the park, there are lots of great rides that they are allowed on that they could be riding while the parents are on rides. In fact Cedar point had three descrete areas for young kids. More...

Concurrent user log for Dynamics GP

A few months ago we kept hitting our seventy five concurrent user limit on our GP server. Rather than rushing out to buy some more licences it was time to investigate how it was getting used.

In order to do this a SQL job was set up sample the current concurrent users on the system throughout the working day, logging the results into a SQL server table for later analysis.

I was not too interested at this point in the detail of who and where people were logged in, merely how many, thus a few mins later we have created a table in the BI database, UserConcurentCount that has two columns, UserCount and TimeDate.

The sql job created had one step running every 10 mins that did the following:

/* Insert into the monitot table how many users visiting */
Insert into BI.dbo.UserConcurentCount
 (usercount,[datetime]) 
(select Count(*) as UserCount, getdate() as SampleTimestamp from dynamics..activity)

This results in a table that can be used to build a histogram using a bit of TSQL and excel of the number of users in the system through the day. The problem seems to be with the changing patterns of work in a small number of the part time staff in some departments causing a pinch point when change over half way though the day occurrs and both sets of staff are in the system. The problem now seems to be resolved and we hover under the user limit now.

Take care to put a clean up script on a weekly job clean old entries out of this log table, no need to build up excessive records unless it is useful to you.