LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use http post to send command to the java scripted web

I want to send a command to a browser controlled local device through http post.

 

by using http get, i can get the information from local device without problem. 

 

however by using http post , the local device seem get the request because I get 200OK code from post header. but the local device can not response the command that i send through post buffer. 

 

I talked with the vendor who wrote the javascript, he said it looks like that the command send to the device, however, the post string i sent can not interpreted by the device.

 

It could be syntax error. 

But what I send through post is the exact the same I found in the web debug tool. 

Anyone can help? 

code.GIFpoststringsent.GIF

 

0 Kudos
Message 1 of 4
(1,080 Views)

Also I am still using labview 2013, which is quite old, while I use  iwebbrowser2 to open the web in labview will show script error. I think it is because the default browser engineer is too old and can not support the web i open. but I am not sure whether it will affect the http post too.  

0 Kudos
Message 2 of 4
(1,079 Views)

And this is the string I send through the post buffer:

the vendor ask me to change the parvalue for "parindex":98," every time use the post, and I did it ,but dose not help. 

 

par: {"params":{"iFielbusControl":{"parindex":85,"parmin":"-","parmax":"-","parvalue":0,"parname":"FielbusControl","partype":"int","parfact":"1"},"iPanelControl":{"parindex":86,"parmin":"-","parmax":"-","parvalue":0,"parname":"PanelControl","partype":"int","parfact":"1"},"iPanelPowerCommand":{"parindex":87,"parmin":"0","parmax":"10","parvalue":0,"parname":"PanelPowerCommand","partype":"int","parfact":"1"},"iPanelPowerCommand2":{"parindex":88,"parmin":"0","parmax":"3","parvalue":0,"parname":"PanelPowerCommand2","partype":"int","parfact":"1"},"iPanelFaultReset":{"parindex":89,"parmin":"0","parmax":"65535","parvalue":0,"parname":"PanelFaultReset","partype":"int","parfact":"1"},"iPanelLaserOn":{"parindex":90,"parmin":"0","parmax":"3559","parvalue":0,"parname":"PanelLaserOn","partype":"int","parfact":"1"},"iPanelBeamOn":{"parindex":91,"parmin":"-","parmax":"-","parvalue":0,"parname":"PanelBeamOn","partype":"int","parfact":"1"},"iPanelPointerEnable":{"parindex":92,"parmin":"0","parmax":"1000","parvalue":0,"parname":"PanelPointerEnable","partype":"int","parfact":"1"},"iPARVALUE_CMD":{"parindex":93,"parmin":"0","parmax":"1","parvalue":50,"parname":"PARVALUE","partype":"int","parfact":"1"},"iPARID_CMD":{"parindex":94,"parmin":"1","parmax":"100","parvalue":48,"parname":"PARID","partype":"int","parfact":"1"},"iNODEID_CMD":{"parindex":95,"parmin":"-","parmax":"-","parvalue":0,"parname":"NODEID","partype":"int","parfact":"1"},"iWRITE":{"parindex":96,"parmin":"-","parmax":"-","parvalue":1,"parname":"WRITE","partype":"int","parfact":"1"},"ipar97":{"parindex":97,"parmin":"0","parmax":"65535","parvalue":0,"parname":"par97","partype":"int","parfact":"1"},"icount_new":{"parindex":98,"parmin":"0","parmax":"1000","parvalue":996,"parname":"count_new","partype":"int","parfact":"1"},"ichecksum_download":{"parindex":99,"parmin":"0","parmax":"65535","parvalue":0,"parname":"checksum_download","partype":"int","parfact":"1"}}}

0 Kudos
Message 3 of 4
(1,074 Views)

anyone can help?

0 Kudos
Message 4 of 4
(1,001 Views)