Skip to content

Commit 57a7b4a

Browse files
Added basic nirfsg example
1 parent 8864160 commit 57a7b4a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/nirfsg/examples/nirfsg_cw.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import nirfsg
2+
import numpy as np
3+
4+
# RFSG session create
5+
options = "Simulate=1, DriverSetup=Model:5841"
6+
session = nirfsg.Session(resource_name='PXI1Slot2', id_query=False, reset_device=False, options=options)
7+
# session = nirfsg.Session("5841", id_query=False, reset_device=False, options=options)
8+
9+
# configure frequency to 1Ghz, power level to -10db and iq rate to 1M
10+
session.configure_rf(
11+
1e9, # frequency
12+
-10 # powerLevel
13+
)
14+
#session.iq_rate = 1e6
15+
#session.generation_mode = nirfsg.GenerationMode.CW
16+
17+
# Start generation
18+
with session.initiate():
19+
# Generation context
20+
input("Press Enter to stop generation")
21+
22+
session.close()

0 commit comments

Comments
 (0)