-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update measurement link examples to match dcpower example changes. (#284
) * update ni fgen example * update the scope example * nidigital example updates * update nidigital examples * update niswitch helpers * nidaqmx example update * udpate the visa dmm example * fix lint erros --------- Co-authored-by: Subash Suresh <[email protected]>
- Loading branch information
1 parent
07d6199
commit fe5e4ce
Showing
30 changed files
with
796 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""nidaqmx Helper classes and functions for MeasurementLink examples.""" | ||
|
||
from typing import Optional | ||
|
||
import grpc | ||
import nidaqmx | ||
|
||
import ni_measurementlink_service as nims | ||
|
||
|
||
def create_task( | ||
session_info: nims.session_management.SessionInformation, | ||
session_grpc_channel: Optional[grpc.Channel] = None, | ||
initialization_behavior=nidaqmx.SessionInitializationBehavior.AUTO, | ||
) -> nidaqmx.Task: | ||
"""Create daqmx task based on reserved session and grpc channel.""" | ||
session_kwargs = {} | ||
|
||
if session_grpc_channel is not None: | ||
session_kwargs["grpc_options"] = nidaqmx.GrpcSessionOptions( | ||
session_grpc_channel, | ||
session_name=session_info.session_name, | ||
initialization_behavior=initialization_behavior, | ||
) | ||
|
||
return nidaqmx.Task(new_task_name=session_info.session_name, **session_kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.