Vb Script And Http S’abonner

0
Avatar
Legacy Poster

So I have a basic question and this is the only thread that even had some close to what I need.

 

We want to trigger every 30 seconds a call to a web service to retrieve data that we would then print.

 

So…..

 

1. Can commander be setup to trigger every N seconds?

 

2. Can we use VB Script in the label format to go and get data using HTTP.  I found this VB Script code online and was wondering if it would work.

 

dim xHttp: Set xHttp = createobject("MSXML2.ServerXMLHTTP")

 

xHttp.Open "GET", "https://yourhost.example.com/foo", False

 

' these values below 2 an 13056 are to ignore get errors

xHttp.setOptions 2, 13056

 

xHttp.Send

 

dim response = xHttp.responsetext

 

3. I can write the rest of the VB Script to parse out the data I need for the labels to print.

 

We have to get a proposal out to a customer ASAP and need to know if this is feasible.

6 commentaires

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Any takers on this?  I do not have software yet to test with so moving in the dark here.

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

The BarTender Trial edition installs along with Commander and is fully operational for a period of 30 days.  This will allow you to test while in the light of day:

 

http://www.bartenderbarcodesoftware.com/label-software/barcode-label-printing-software-download.aspx

 

1. What are you looking to trigger Commander with?  A file or TCP/IP network message?  Files can use polling by ms (1000 for each second you want) and TCP/IP messages rely on socket state and received data.

 

2. Using AJAX style calls in a BarTender document is not advised as they would need to be synchronous (blocking), and in any case would take too long for the BarTender print process.  BarTender could either just timeout on it and drop the data, or lock up.  Why would you not provide any data you want printed n the original trigger sent to Commander?  Commander can take data and commands in the trigger, with BarTender XML script being the ideal content.  See the BarTender Help system for a full reference.

 

What is the purpose of such a VB script?  What is the intention of what you want to do?

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

With more and more cloud solutions it is not easy to have that cloud solution push data to a specific file or TCP event.

 

In this case we need to pull the data from the cloud solution as we cannot get a push of data.

 

We do this in Excel and Access already for reporting purposes using VBA Script and it is very fast for us and the data pull is based on last successful one.

 

For example a user has a device that he is adding inventory to a cloud solution.

 

We want to print labels for that inventory within 30 - 60 seconds.

 

The cloud solution has no way to push the data to us so we have to pull it from the cloud.

 

So it does not seem that bartender has a timer based trigger where we can fire it to print labels on an interval based on time and not a file or TCP event?

 

Then the only other potential is for us to use an alternative scheduler launch bartender it seems unless I am missing something.  That seems like an obvious need to fire against a time interval.

 

I will check out the free trial code as well - thanks.

 

Shawn

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

As it stands, your best bet is to create a front-end application that pulls the data from the cloud on request/timer, and then controls BarTender via automation to print a label with that data.  You could leverage Access/Excel to do this if you want with your pre-existing VBA routines.

 

http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Controlling-Barcode-Label-Software-using-C-Sharp-and-VB.NET(English).pdf

 

http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Controlling-Barcode-Label-Software-using-ActiveX-Automation.pdf

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Thanks - so how do we add in feature requests so Commander can not just fire off a file poll or TCP event and add in a timer event as well?

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

I've logged a feature request into our internal development system asking that we add a trigger type to support making an HttpRequest, to an http server, to pull data on a variable timer set by the user.  This probably won't happen any time soon, so I strongly suggest that you look into implementing the solution I suggested.

Vous devez vous connecter pour laisser un commentaire.