I have a serial device that returns 23 hex values. I read the values using system.serial.readBytes('COM1', 23) in Ignition. This returns array('b', [-85, 112, 1, 18, -79, 0, 1, 116, -41, 2, -17, 10, 28, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0]). I know the values here are decimal from signed 2's complement, but how can I get the decimal value? For example -85 should be 171, or 0xAB in hex. I would prefer to directly read the hex values, but I don’t know how to do this. Any idea?
Read hex or decimal from serial in Ignition
505 Views Asked by konichiwa At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in SERIAL-PORT
- C# PCI Express Serial Port
- USB to Serial, Port Name Changing Unexpectedly
- Connecting a USB serial device to the Arduino directly
- Sending gcode string to 3D printer through a serial port
- Raspberry PI USB to RS232 adapter Receiving Only Ctrl Chars
- Read and write data multiple times on a serial port with a single click
- Processing in Java Serial object Null Pointer Exception
- Why can't I open/write from a serial port on Android?
- fconfigure refuses to set baud rate to 921600
- Multiple objects containing SerialPort with same SerialDataReceivedEventHandler
- Nodejs send data to Arduino using serial
- PHP dio_read taking taking 1 minute to execute each task
- Serial Port Write Echo
- Linux Shell, How to send a command over Serial port and return?
- Turning Textbox Red with a timer when serial port stops outputting data
Related Questions in HEX
- match hex string with list indice
- Twig : Unescape hexadecimal text
- Split a string and convert individual pieces to hexadecimal
- What are the values that appear at the address bar?
- Benefits of storing hex in DB over file
- Unique hex for unique string in java
- convert first column from hex to decimal using awk
- Convert a 0-1 value to a hex colour?
- How can I edit a binary file under Windows by scripting
- How to count the number of characters in a line in a csv file
- c# manipulating a string as a hex code?
- Find and replace hex values in a String in Java using regex
- Passing argb array to int or long
- Converting an Array of Hexadecimal Strings to Numbers
- how do i convert a hex string to its unicode ascii equivalent in swift?
Related Questions in DECIMAL
- Need Helped Understanding an 8-Bit Signed Decimal with 2's Compliment
- PHP Allow only numbers with 2 decimals
- Excel does not display zero decimal when opening an exported CSV file
- Entity Framework Decimal Truncation Issue
- Comparing two decimals
- Add binary numbers like decimal numbers in Java. eg 0101 + 0110 = 0211
- Python decimal.Decimal id not the same
- Function to convert double to string with given options
- Saving Ruby Decimals in Form
- Java: I want to get an Integer output in double datatype
- search the column with decimal value for '.'
- Decimal out of range exception
- Converting User Chosen Base to Base 10 - MASM
- Control outputted decimal places globally
- Can someone help me explain this code that is converting decimal fractions into a binary?
Related Questions in IGNITION
- Decompress chunk where shouldnt be
- LAG and GROUP BY not compatible in Maria DB SQL
- SQL Query Update subtract variable
- Laravel upgrade to 7.x throwing composer error in ignition package
- Read hex or decimal from serial in Ignition
- Device order ignition config, flatcar-container-linux
- Conversion failed when converting the varchar value '43302001-8' to data type int
- Python Scripting question, probably very simple but I have little experience in this code
- Laravel Errors disappears (Ignition)
- Ignition OPC UA connection fail
- Query'd top 15 faults, need the accumulated downtime from another column
- SQL - Trying to add rows to a table with while loop, but no rows get added and I get no error message
- Gazebo Garden installation problems with cmake and msbuild (Windows 10)
- How to avoid parameter reference/substitution in tags and UDT
- How to Add Value in Indicator in Linear Scale Component on SCADA Ignition
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can convert them easily to a decimal value.