LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert time from mili seconds to micro seconds

Hi,
I have to interface an instrument using RS422 serial port. While I used VISA Config Serial Port to configure the Port (as attached), I want to input the "time out value" of Property Node (arg 1) in micro seconds rather than mili seconds.

Kindly help me to resolve the issue.

Thanks

 

0 Kudos
Message 1 of 6
(2,452 Views)

Divide.png

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(2,436 Views)

Well, the smart-alec answer is, "just scale by 1000".  But what I suspect you want is to specify a timeout with smaller-than-miillisec resolution such as 200 microsec.

 

Sorry to say, that won't be possible.  The API for VISA sets the rules here and it requires an integer # of millisec.  That simply reflects the reality of any regular OS, where it would be disingenuous to make an API that implied that it could reliably *honor* sub-millisec timing intervals.  

 

 

-Kevin P

 

P.S.  Oops, second time this morning I started a reply, got interrupted for a few minutes, came back to finish and then saw that someone got there first.  Only this time, it looks like I inadvertantly called Ben a smart-alec.  Which I didn't mean to do, but which he also might not argue against anyway.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 3 of 6
(2,427 Views)

@Kevin_Price wrote:

Well, the smart-alec answer is, "just scale by 1000".  But what I suspect you want is to specify a timeout with smaller-than-miillisec resolution such as 200 microsec.

 

Sorry to say, that won't be possible.  The API for VISA sets the rules here and it requires an integer # of millisec.  That simply reflects the reality of any regular OS, where it would be disingenuous to make an API that implied that it could reliably *honor* sub-millisec timing intervals.  

 

 

-Kevin P


True.

 

The only alternative would be to cod it up explicitly check the number of bytes at the port and only reading when the right number are there. It would also have to be run on a RT target were sub-millisecond timing of loops can be used.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(2,421 Views)

@Ben wrote:

Divide.png

 

Ben


Umm ... you don't like the regular Divide function?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 6
(2,395 Views)

@paul_cardinale wrote:

@Ben wrote:

Divide.png

 

Ben


Umm ... you don't like the regular Divide function?


I do but I thought I would do something different.

 

Spoiler

 

"If you were supposed to divide with the compound arithmetic, you wouldn't be able to invert an input."

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(2,393 Views)