keysight | javascript keyboard events | Keyboard library
kandi X-RAY | keysight Summary
kandi X-RAY | keysight Summary
keysight(event) - Takes in a keyboard event from keypress, keyup, or keydown and returns an object that has the following properties: * key - The keyboard key pressed. Does not take into account shift, so for example if you type 'A', this will contain 'a'. * char - The character created by the key press. Takes into account shift, so if you type 'A', this will contain 'A'. Note that in cases where there are multiple keys that give the same character, the simpler character is used (eg. if the key is "num_enter", char will be "\n"). keysight.unprintableKeys - A map of unprintable keys (including backspace and delete, which do usually modify inputs) where each object-key is the name of an unprintable keyboard-key.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of keysight
keysight Key Features
keysight Examples and Code Snippets
Community Discussions
Trending Discussions on keysight
QUESTION
I am currently working on a program, built with Python and Tkinter to interact with different instruments in our lab and to test some electronic devices. There I have a function (isDutAlive()) which can take really long (up to 10-15 minutes) until the function finishes. Now the Tkinter GUI is not responding during this time and to the user it looks like the program has crashed. Also no other operations are possible. Here is the code:
...ANSWER
Answered 2020-Sep-22 at 10:05I think you are well on your way. Multithreading is indeed a way to solve this problem. You are essentially trying to do something asynchronous.
The quickest way might be to include threads like you mentioned. A good resource for that would be this page on realpython.com. Specifically on the topic of barriers or deadlocks which I think answers your question.
Alternatively if you calculate this to be happening more and the results can be show X time later without the user still actively waiting for them is to use some sort of asynchronous system with a broker. The thing I used in a similar situation is Celery. I combined it with the easy to use RabbitMQ instance.
Using this setup your users will create "todo" tasks in a predefined queue which will then be handled. The output can be stored in a result queue where your application could subscribe to. There are some advantages and disadvantages to using this solution which may or may not be dealbreaking in your case.
Advantages:
- Really asynchronous, so as long as your application can reach the RMQ server it should have next to 0 impact on your system and the GUI will always remain "up".
- No matter how many times the users will press the button, it will not have to wait for results.
Disadvantages:
- Each items will be executed separately. Putting 5 items on the queue means the same action will be executed 5 times.
- There is need to extra software (RMQ or another broker) as well as extra libraries (celery)
- Users will actively have to get the result of their actions. This might be a hurdle.
I hope I've given you some pointers to possible solutions?
QUESTION
I am using python's socket module to send a simple SCPI command to my Keysight device, but I get a blank response. Does anyone know what I am doing wrong?
Here is my simple script.
...ANSWER
Answered 2020-Jul-24 at 20:33These two versions are not the same.
You're not seeing any output in the first case because you're not actually sending a complete message from the socket to the server. The telnet
protocol uses \r\n
to end lines, not just \n
. So you'd need to do s.send("*IDN?\r\n")
.
But really, you should use a better tool for the job. Python's socket
module is just direct bindings to the BSD socket interface, usually used for building low-level networking applications. As such, you'll need to worry about annoying details like the line-endings yourself. A better alternative is to use a higher-level library, more tailored for your purpose. telnetlib
is a builtin module for operating as a telnet client, or you could use a third-party library explicitly for SCPI.
QUESTION
ANSWER
Answered 2020-Apr-25 at 00:06It's horizontally compressed so you can resize the height dimension and it mostly works; I augmented the vertical dimension by ~25%, and added ~10% to the horizontal dimension.
QUESTION
In the Keysight OpenTap
There is Test- Step 1. I would like the pass the result obtained by Test-Step 1 to any of the Test-Step-n Example : Test-Step1 executes SCPI Query and then the result obtained from this, has to be passed to Test-Step-N.
For this approach, we have extended a Test-Step and created our own Test Step. Is there any in-built feature In TAP we could make use of it?
...ANSWER
Answered 2019-Sep-26 at 07:57Are you asking for this feature to be provided by the built-in 'Basic/Flow Steps'?
Input/Output parameters are fully supported by the OpenTAP engine and as you point out, you have created your own TestStep which I assume has utilised this approach.
Any generic Teststep that would consume the output of another TestStep would need to understand the data to make any use of it other than in the simplest of cases.
Do you have a specific example?
QUESTION
I'm trying to send a command to a remote device: E5071C ENA Vector Network Analyzer
These are my problems:
When I try to send and receive data from the socket, it "hangs".
I am not sure which type of socket I should use.
For the other commands, I used s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
, but I only had to send data in those cases. Here I need to send and receive data. I have tried to use a while True
loop like this:
ANSWER
Answered 2019-Aug-06 at 22:37socket.accept()
is only relevant in the context of a stream-based socket that's been configured as a listening socket. It doesn't make sense to use on a datagram socket, especially one that's already associated with a remote host.
(Are you sure SOCK_DGRAM
-- i.e. UDP -- is correct here? Most SCPI devices I've worked with use TCP, i.e. SOCK_STREAM
.)
If you're sure that you're using the right protocol, remove the call to s.accept()
, and call .recv()
on the existing socket s
.
QUESTION
A python-based BER confidence level calculator is being developed for a GNU Radio OOT. From reference 1, the confidence level is calculated by the equation
However, reference 2 calculates the confidence level by using the formula:
The first question is about the two formulas. Why are they different? I did try to implement both of them. The first version is pretty straightforward. However, the exponential and the factorial operations in the second formula caused an "OverflowError: math range error" problem. How do we deal with this?
...ANSWER
Answered 2019-Aug-08 at 08:53Why are the formulas different?
Formula 1 can be used only if you have zero errors (i.e. E=0). In that case, it is equivalent to formula 2.
Formula 2 can be used to compute the confidence level no matter how many errors you have observed.
How do we deal with the overflow?
The term e^(-N*BER_s) * sum(...) in the second equation is the poisson cumulative distribution function with parameters lambda = N*BER_s and k = E. Conveniently, this function is implemented in the scipy.stats module. Thus, we can compute the confidence level as follows:
QUESTION
Binary Library: Not Found Error.
I am running from Git Bash with Windows 10 and using pip to install packages.
I installed Ni-VISA from their website and the pyVISA and pyVISA-py packages.
I have the visa32.dll and visa64.dll in C:\Windows\System32.
I have tried installed the development version of pyvisa-py. Did not work. My Paths under Windows' "System Variables" are identical to those on another machine that works correctly.
Thanks in advance for the help. I'm embarrassed to say how much time I've spent on this.
...ANSWER
Answered 2019-Jul-23 at 16:49Finally, figured it out.
In the directory C:\Users[username], create or modify the .pyvisarc file (this is a unique file extension). Then add the following text inside which points to your visa32.dll :
QUESTION
I have a data file (Sample_Eye_1.txt
) which I obtained from the simulation plot of ADS Keysight. It has 3 fields - "Index", "Time" and "Voltage"
. Now the eye diagram plot will be voltage vs time
. There can be different voltages at the same time at only different index. So index can be seen as a data filter field or similar like that. The plot in ADS simulation is the following
You can see that the line plot is plotted like it is superimposed on different lines.
Now when I plot data in MATLAB voltage vs time
, it is not superimposed somehow. This is the plot generated plot of my matlab code which is just simple xy plot.
My MATLAB code:
...ANSWER
Answered 2018-Aug-17 at 18:16Your code is fine, the problem is due to the way you plot the data.
QUESTION
I want to format the data into a dataframe or file with specific format. I have extracted the data from ADS Keysight. But the data structure is not useful for further processing. The data file has R(1,1) to R(2,2), L(1,1) to L(2,2), G(1,1) to G(2,2), C(1,1) to C(2,2) data for different frequencies. The file has only 2 columns 1st column is "Freq" and 2nd column is either one of the RLGC data. I have given an example here only foe 3 frequency for each of the data. And the target format as well.
The real file contains 3000 frequencies of data.
The data file is (The two columns are tab separated):
...ANSWER
Answered 2018-Jun-30 at 21:00Use:
QUESTION
I am trying to find a way to extract a value for a Monitoring Data file and use it further. Using an SSH connection (with password) i would like to access a file which is remotely located. The in this file I would like to search for a particular sensor name. Since this file contains data from lot of sensors and from different timesteps, I would like to pick the last (latest) string and next to this string is the sensor value and I would like to copy it and write it in a local data file and use it further in the programming. I could copy the whole file from server to local but the whole file is big and the file keeps changing every hour.
Time Sensor-name Sensor-value
25-05-2018;15:24 t_amb 24.8
25-05-2018;15:24 t_room 21.2
25-05-2018;15:24 G_global 120
25-05-2018;15:25 t_amb 25
25-05-2018;15:25 t_room 21
25-05-2018;15:25 G_global 227.8
For Example in the above mentioned file which is located in an another computer which is connected via SSH port, I would just like to search for the string 't_room' and find the last occurrence of it in the remote file and write the value next to it '21' into a file which is located at a directory locally.
Edit: More or less I want to do a similar thing but instead of a bash script I want to do it in Python :
...ANSWER
Answered 2018-May-25 at 13:47You can pipe the data to grep
to select the last line with tail
containing "t_room", then print the 3rd column separated by space using awk
.
For example, if your data is saved in log.txt:
cat log.txt | grep t_room | tail -n 1 | awk -F" " '{print $3}'
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install keysight
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page