12-15-2020 01:40 PM - edited 12-15-2020 01:42 PM
wiebe@CARYA wrote:
@XM43 wrote:
wiebe@CARYA wrote:
@XM43 wrote:
wiebe@CARYA wrote:
What are the while loops for? They don't do anything...
Other than the while loops and the coloring of the structure diagrams that is the way to do it.
Yes Sir! my mistake, while loops are there as part of my template VI. But yes, it does not do anything.
Please now that I am new to LabView, actually 6 months into any kind of programming. So yes, I am playing with every possible thing that I come across in LabView including background colors.Sure. Kudo for posting!
Note you can also color the structures themselves. But (also) please don't.
Haha, yes, I do not do that anymore and I will keep that in mind. But a bit darker color is soothing for eyes especially if you are working for longer hours.
Oh and thank you for Kudos, my first Kudos 😀Actually your 2nd.
You got the first here: Solved: Re: Requesting suggestion for possible software architecture design with PC- RT-& FPGA
oh yes! my bad. I did not recall that one but when I realized I corrected my recent post. 😛
Edit: Crossed my response.
Anyways, I love this community! So much knowledge! Nice People!
12-16-2020 12:11 AM
Thanx. Your code shows what I have but I do not see any extra functions/processes to deal with the authentication. Maybe happens hidden? Nothing I need to worry about as long as I have a valid key?
BTW, I think I need to expand the Header more. I have some example bash-files with curl and rather long headers.These bash scripts communicate with the server and its functionality I will try to copy to Labview.
Do I have to "Open Handle" and "Close Handle" every time I send data with POST? Why not Open in the morning, working, and then close in the late afternoon?
12-16-2020 03:34 AM
@TakeANap wrote:Do I have to "Open Handle" and "Close Handle" every time I send data with POST? Why not Open in the morning, working, and then close in the late afternoon?
Nothing wrong with that.
You'll have to rearrange the error handling though. I mean, if there is an error, you'd need to reinitialize. I'd recommend using a class for this.
You'd probably get more information than just the session reference, so you can conveniently reinitialize if needed. It would fit perfectly in a class...
Depending on the situation, I'd make a OO state pattern (not a state machine). It would be off topic to go into this too much, but it can work very well.
12-17-2020 08:42 AM
Ok. I got everything working now. Authorization etc. Used Add Header, content Type and so on and POST/GET. No problems.
Now, I must decide about the structure. Because I'm a newbee in comm in LV I want to ask about the method how to deal with the "Client Handle" after an OpenHandle.
Two ways:
1) OpenHandle. Send Data. Close Handle. Amount of data, about 500 bytes each 30 sec.
2) OpenHandle in the morning. Save it in a global var. Send data during day with a handle from the glob.var. CloseHandle in the evening.
Alt. 2 needs error handling. Reconnect if failure.
What is best alternative? What alt are most normal? I feeling bad about connect/disconnect often. Why? Don't have any answer.
12-17-2020 12:11 PM
My opinion didn't change since Re: How to start connect and comm with server using REST (GET, POST...) - Page 2 - NI Community
12-17-2020 02:46 PM
Ok. I gave two ways of doing this and I wasn't really sure but I interpret you as it is ok to "OpenHandle" in the morning and Close after work. Of course, check the connection and reconnect if necessary.
Thanx
12-17-2020 03:27 PM
@Haddock01 wrote:
Ok. I gave two ways of doing this and I wasn't really sure but I interpret you as it is ok to "OpenHandle" in the morning and Close after work. Of course, check the connection and reconnect if necessary.
Thanx
That would be my preference. Opening and closing all the time is just a waste of resources (time, mostly).