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:

Bandpass filter: {“type”:”bandpass”,”port”:1,”center”:193.5,”bandwidth”:0.1,”attn”:0}

Gaussian filter: {“type”:”gaussian”,”port”:1,”center”:193.5,”bandwidth”:0.1,”attn”:0}

Block All: {“type”:”blockall”}

Transmit All: {“type”:”transmit”,”port”:1}

Click on the POST button to send the command through to the instrument. The following is a typical response:  {“msg”:”OK”,”rc”:0,”sno”:”200428″}

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:

{“type”:”wsp”,”wsp”:”FREQUENCY\tATTENUATION\tPHASE\tPORT\nFREQUENCY\tATTENUATION\tPHASE\tPORT\nFREQUENCY\tATTENUATION\tPHASE\tPORT\n”}

This is a snippet of one example

{“type”:”wsp”,”wsp”:”190.950\t60.00\t0.00\t1\n190.951\t60.00\t0.00\t1\……… n196.474\t60.00\t0.00\t1\n”}

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:

gaussian_wsp using POST

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.

Please rate this article