Can you tell,
1) How you test the printing while development? (do you have the same
printer with your development machine?)
2) How your system recognizes the end of bar code?
3) Using PrintDocument object do you have done e.HasMorePages = False at the
end of printing?
On Wed, Sep 3, 2008 at 2:19 AM, raz230 <[EMAIL PROTECTED]> wrote:
>
> Yikes- you're right. I forgot that.
>
> I was looking for feedback on the above process really. I was
> wondering if this was really the best way to background poll a scale
> connected to a PC via serial.
>
> To briefly explain what this program does:
>
> 1) user places a package with a bar code on the exterior of the
> package on the scale and scans the bar code with hand bar code reader-
> also connected to the PC
>
> 2) the above process causes all the customer info and client info to
> be looked up along with the shipping rate and type and in the end, a
> label comes off a printer that we stick on the package for shipping.
>
> The label is printed with a print document object and printed out to a
> zebra thermal printer.
>
> On the deployed machine, only AFTER the bar code scanner unit was
> connected, the system does all of those steps and indicates it's
> printing and you can see the printed file appear in the printer
> control panel - but nothing comes out.
>
> If you manually type in the numbers that the bar code scanner reads,
> it works perfectly all the time. Also, in the development environment
> using the same peripherals, I cannot replicate this problem at all.
>
> Regarding the scanner, I've accounted for the scanner input (IE, it
> doesnt send CRLF, tabs or anything else, it just reads the bar code)
> and I have also made sure the bar code data doesn't contain unexpected
> things either.
>
> As I understand it, bar code readers are like Keyboards as far as
> windows is concerned but it does seem like the problem only happens on
> that machine (the single processor one)
>
> I'm not sure if I am correct to suspect the thread/core issue but that
> is the only thing that is different.
>
> Am I barking up the wrong tree?
>
>
>
>
>
>
>
>
> On Aug 30, 8:24 am, raz230 <[EMAIL PROTECTED]> wrote:
> > I have a problem has occasionally happens in my program. The program
> > is is a shipping system and has a scale connected to the PC with a
> > serial cable.
> >
> > I use a background worker from inside a timer control to poll the
> > scanner for it's weight and display it on the main form's window in a
> > textbox control.
> >
> > The computer I develop on is a dual core machine. I'm not sure if
> > this has any bearing but I can tell that I do not observe the problem
> > at all in the development environment.
> >
> > I have this tick event on the main form:
> >
> > If My.Settings.UseScale = True Then
> > Try
> > BackgroundWorker1.RunWorkerAsync()
> > Catch ex As Exception
> > BackgroundWorker1.CancelAsync()
> > End Try
> > End If
> >
> > The dowork event of the background worker looks like this
> >
> > Private Sub BackgroundWorker1_DoWork(ByVal sender As
> > System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
> > Handles BackgroundWorker1.DoWork
> >
> > Dim worker As BackgroundWorker = CType(sender,
> > BackgroundWorker)
> > e.Result = GetScaleValue() 'returns a string
> >
> > End Sub
> >
> > And in the GetScaleValue function- the code that polls the scale looks
> > like this
> >
> > Public Function GetScaleValue() as String
> >
> > Serial.Write("W") 'send "W" and read the reply
> > txtDefaultWeight.Text = Serial.ReadExisting.ToString 'this is the
> > reply
> >
> > If txtDefaultWeight.Text.Length > 2 Then 'clean up the reply
> > With txtDefaultWeight
> > .Text = .Text.Remove(0, 1)
> > .Text = .Text.Remove(txtDefaultWeight.Text.Length - 1, 1)
> > End With
> > End If
> >
> > End Function
> >
> > Is this the correct way to handle this? I'm sure there's more than
> > one way, but is what I have wrong or flawed?
> >
> > Rob
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---