Comments (6)
Please give an example of what you want to do
from jvisa.
send hexadecimal data device
from jvisa.
The string "01 03 00 80 00 07"
contains the character 0
, then the character 1
, then a space character, and so on.
Demonstration:
public static void main(String[] args) {
printStringBytesInHex("ABCD");
printStringBytesInHex("01 03 00 80 00 07");
}
private static void printStringBytesInHex(String str) {
final byte[] bytes = str.getBytes(java.nio.charset.StandardCharsets.US_ASCII);
for (int i = 0; i < bytes.length; i++) {
System.out.printf("%02X ", bytes[i]);
}
System.out.println();
}
Sample output:
41 42 43 44
30 31 20 30 33 20 30 30 20 38 30 20 30 30 20 30 37
Table of ASCII characters:
I will add JVisaInstrument methods to send bytes instead of a string.
from jvisa.
from jvisa.
You are welcome!
I added methods to write byte[]
instead of String
, please test it:
Let me know if you need help getting the new code.
from jvisa.
Can you test the new method to write a byte[]
?
from jvisa.
Related Issues (13)
- is using keysight visa stable? HOT 4
- How to find resources connected to another computer (not localhost)? HOT 6
- Does JVisa support communication with ASRL?::INSTR? HOT 12
- Does JVisa support requesting and parsing binary block data? HOT 18
- JVisa for Android HOT 1
- Does this library work on Linux? HOT 14
- Does this library work on MacOSX? HOT 23
- system error? return value problem HOT 3
- system error? return value problem HOT 1
- M1 Mac errors, please advise. HOT 4
- Timeout expired before operation completed HOT 18
- Visibility of `JVisaInstrument.readBytes(int bufferSize)` method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jvisa.