LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to start connect and comm with server using REST (GET, POST...)


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!

0 Kudos
Message 11 of 17
(389 Views)

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? 

0 Kudos
Message 12 of 17
(364 Views)

@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.

0 Kudos
Message 13 of 17
(358 Views)

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.

 

 

0 Kudos
Message 14 of 17
(340 Views)

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

 

0 Kudos
Message 16 of 17
(316 Views)

@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).

0 Kudos
Message 17 of 17
(304 Views)