How can I load filter profiles to an A Series WaveShaper using the POST command in a browser?
When controlling a WaveShaper programmatically using an external program such as Python or LabView, it can be helpful to troubleshoot using the browser. This helps in that the browser is programming language agnostic. It can eliminate any issues that might be related to my programming language.
GET commands work by simply pasting the url directly into the browser.
For POST commands, it’s a little more difficult. To enable the browser to load filter profiles to the WaveShaper, you will need to enable an extension to the browser. In the case of Firefox, a couple of recommended extensions are “RESTer” or “RESTClient“.
To load a profile, note down the IP address of the WaveShaper connected to the network. In this example, the IP address is 10.118.27.61.
Select the Method to be POST
Enter the URL: http://10.118.27.61/waveshaper/loadprofile
The following commands can then be entered into the “Body” window:
Click on the POST button to send the command through to the instrument. The following is a typical response:
To send a WaveShaper Filter file ( .wsp) through to the WaveShaper using the HTTP POST command can be laborious if done manually but there are JSON Parsers/Serializers that can make that conversion easily.
The format of the .wsp file needs to be changed from the standard, TAB delimited text file. The columns for a standard .wsp file are:
FREQUENCY ATTENUATION PHASE PORT
This is an example of the standard format:
Note that each frequency can be defined down to 0.001THz. The WaveShaper will account for any missing frequencies by using a nearest neighbour interpolation and only the frequencies of interest need to be programmed.
The format to upload as a HTTP POST command is one continuous line with no spaces or TABS in the file and is as follows:
This is a snippet of one example
Click on the “guassian_wsp using POST” example text file to get the complete text file. This example is a Gaussian filter for use on a C Band WaveShaper with output port 1:
The content of the text file is copied into the “Body” window and then POSTed to the WaveShaper. The current profile is then updated in the WaveShaper App which will confirm a successful upload.