Shop OBEX P1 Docs P2 Docs Learn Events
Logging data locally onto Win based machine, offline only? — Parallax Forums

Logging data locally onto Win based machine, offline only?

xanatosxanatos Posts: 1,120
edited 2011-04-25 07:37 in General Discussion
Hi,

I'm using a PINK server which contains an embedded website that I use to control (via a BS2SX) some machinery.

I'd like to be able to have the local PC be able to log the usage data to a text file on the PC.

If I was doing this online, I would use VBScript or PHP to log to the server... but this PC cannot go online, it is miles from a wifi connection, so I need to write from the browser window to the text file, which I know can't be done directly. I also don't have the option of using a Windows version with a local server built in.

I have read a little about Flash player 10 being able now to use AS3 and the filereference object to write text files locally from a browser, but I am wondering if anyone else on here has any experience doing what I am seeking?

Any ideas?

Thanks,

Dave

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-04-22 17:37
    Maybe I'm not reading the question correctly, but how will Flash or a web browser accomplish anything if the PC can't connect to the PINK to begin with?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-04-22 17:55
    I'm confused, too. In the same sentence you state that the PC can't go online but talk about a "browser window". What is the PC browsing?

    -Phil
  • xanatosxanatos Posts: 1,120
    edited 2011-04-24 17:23
    Sorry for not being clear folks, "online" as in "The Internet" - as in "out there" - but the PINK is hooked to the laptop via the crossover cable... By online, and with reference to ASP/VBScript/PHP, these would be the server-side scripts that would run on a Windows or Unix/Linux based server, but these technologies do not run on the PINK. Hence my question.

    HOWEVER - in the interim, I have found that there is a client-side JScript way of doing this that does, in fact, create a text file on the user's desktop (with appropriate security permissions needing to be set to allow such a normal violation of basic security functions!) - but I have the function working at this point. Basic new ActiveXObject("Scripting.FileSystemObject");, kind of stuff - works like a charm.

    Thanks for your willingness to examine my post.

    Dave
  • Mike GMike G Posts: 2,702
    edited 2011-04-25 06:13
    With just a few lines of code, you could have done this in C# or any high level language. Then you're not stuck with browser dependencies, IE in this case. Plus you get mote flexability. The EXE could run as a service, command line, console... it can also be scheduled.

    If you have IIS (or another web server) on your PC, then you could have used a server technology ASP/VBScript/PHP. You're simply making an HTTP request.
  • xanatosxanatos Posts: 1,120
    edited 2011-04-25 07:37
    Hi Mike,

    As I stated earlier, since ASP/VBScript/PHP does not run on the PINK Server, and the laptop I must use in this application runs Windows 7 "starter" edition (which I never even knew existed), and that the operator who uses this specified it must be a web-browser-based control.... I didn't have these options.

    C# or C++ would have been attractive options, but as I said, I found the solution on my own using the ActiveXObject references in the JScript language which allows the code to be embedded in the website code in the PINK Flash memory, and it creates/writes to the laptop just as I needed it to. Only 8 total lines of code, simplicity in itself.

    Dave
Sign In or Register to comment.