semvec/pypi-packages huggingface dataset:
PyOmicronCMC 0.1.0
A python module to make scripting an Omicron CMC test set suck a little less.
Requires Python: >=3.11

# PyOmicronCMC

>**A python module to make scripting with a CMC test set suck a little less.**
v0.0.1
```
pip install 
```
### Supported Test Sets
- [X] CMC 256 <sup>plus</sup>
- [ ] TBD

### Requirements
 - Python 3.11+
 - CM Engine
 - PyWin32
 ```
pip install pywin32
 ```
---
### Hello World

 ```python
from PyOmicronCMC import *
myOmicron = Omicron("TestSetSN")
 ```
 ```
> -- Searching for Omicron Device.
> -- Omicron Device Found.
> -- Locking Omicron Device.
> -- Restoring Device Defaults.
> -- Releasing Omicron Device.
 ```
---
### Analog Outputs
##### Configuration
```python
matchingConfigurations = myOmicron.FindAmpConfigurations(
    VI='v', 
    minNumOfPhases=3, 
    minOutputMag=55, 
    mode=WiringConfigurations.std
)
selectedConfig = matchingConfigurations[0]
 
myOmicron.LoadAmpConfiguration(TripleIDs.v1, selectedConfig)
```

##### Setting Outputs
```python
myWaveform = WaveformDefinition(
    wavType=WaveformTypes.Sine, 
    amplitudes=[5, 10], 
    frequencies=60, 
    phases=[0, 90]
    )

myOmicron.SetTripleOutput(TripleIDs.v1, myWaveform)
time.sleep(5)
```
![Analog Output Operation Example](Resources\Images\AnalogOutEx1.png)
---
### Binary IO
##### Input Configuration
```python
myOmicron.SetBiThresholdVoltage(5.0,  groupNumbers=[1])
myOmicron.SetBiThresholdVoltage(15.0, groupNumbers=[2])
```
![Binary Input Threshold Config Example](Resources\Images\BinThreshEx1.png)
##### Reading Inputs
```python
binaryInputs = myOmicron.GetBIs()
print(binaryInputs)
```
```
> [True, False, True, False, False, False, False, False, False, False]
```
or
```python
binaryInputs = myOmicron.GetBIsInt()
print(binaryInputs)
```
```
> 5
```
##### Writing Outputs
```python
myOmicron.SetBOs(B1 = 1)
time.sleep(0.5)
myOmicron.SetBOs(B2 = 1)
time.sleep(0.5)
myOmicron.SetBOs(B3 = 1)
time.sleep(0.5)
```
![Binary Output Operation Example](Resources\Images\BoutEx1.png)