09-05-2014 06:41 AM - edited 09-05-2014 06:58 AM
Hello, Im currently using a web service request (particularly the read request variable). What my application does is that when a user enters the url
http://127.0.0.1:8001/WebService/Process?1=1&2=0&3=1&4=0&5=0
LED 1 and 3 turns on, while the other LEDs are turned off. I would like also to keep text file logs on what is the current time now, and the status of the LEDs. I want only to write to the file everytime the user enters the query in the URL (I dont want to write the logs every second or so, just only when the user presses the go button in the browser)
I can now write to a text file the current datetime stamp, and already setup the web services. But I cant figure out how can I execute this write process everytime the user fires up a web request.
Basically, how can I write to a text file the status of the LEDs each time there is a URL request?
Attached is the project. Thanks
09-08-2014 12:49 AM
In the web service you have a VI that executes when the url is called. Put the logic there to write the required information to the file.
Mike...
09-08-2014 01:28 AM
@mike, Ive putted the write logic inside the VI, and it doesnt execute whenever I fire a web request.
09-08-2014 02:25 AM
09-08-2014 02:48 AM
09-08-2014 02:48 AM
09-08-2014 09:57 AM
09-12-2014 08:06 PM
09-13-2014 12:11 AM
I believe the default for open file is 'open', not 'create'. If that is the case you are definitely getting an error, and you just are not checking for it or handling it.
I'd also recommend against the idea of logging directly from the web method. If you ever decide to add additional methods it would be easier to send log commands to a central vi. take a look at startup vis.