Skip to content

Commit

Permalink
Added 2600B TSP-Link Triggering Example
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad-O committed Jan 3, 2024
1 parent 16ad9b8 commit 18a0f4d
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions Instrument_Examples/Series_2600/Triggering/TSPLink_Trigger.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
--[[
Purpose: show how an event on one 2600B can be "echoed" to second 2600B
Setup: need two 2600B that have TSP-LINK connectors.
Assign node 1 and 2 and use the cross-over cable to link them.
On front panel, use the reset under TSPLINK to verify the link.
Method: Use a timer as stimulus for digital IO active lo pulse.
Cause 10 pulses from DIO line 1 on rear DB25 connector.
Echo the timer event_id on tsp-link for digital IO on second node to also pulse.
Written By: Keithley Applications Engineering (Andrea Clary)
From the TekTalk Forum: https://my.tek.com/en/tektalk/source-measure-units/9b622205-b095-ee11-a81c-000d3a37f78a
]]--

function ConfigTSPLinkTriggers(nodenum)
node[nodenum].tsplink.trigger[1].clear()
node[nodenum].tsplink.trigger[1].mode = tsplink.TRIG_FALLING
node[nodenum].tsplink.trigger[2].clear()
node[nodenum].tsplink.trigger[2].mode = tsplink.TRIG_FALLING
node[nodenum].tsplink.trigger[3].clear()
node[nodenum].tsplink.trigger[3].mode = tsplink.TRIG_FALLING
end

-- *********************
--
-- Main Program
--
-- *********************

reset()
errorqueue.clear()

if tsplink.state == "offline" then
nodesFound = tsplink.reset()
if nodesFound ~= 2 then
print(string.format("Error: Found %d Nodes. Expecting 2.", nodesFound))
exit()
end
end

-- for each tsplink node
ConfigTSPLinkTriggers(1)
ConfigTSPLinkTriggers(2)

-- configure a timer on node 1 to issue 10 events
-- upon receipt of one tsplink event_id
nodenum = 1
node[nodenum].trigger.timer[1].delay = 1e-3
node[nodenum].trigger.timer[1].stimulus = node[nodenum].tsplink.trigger[1].EVENT_ID
node[nodenum].trigger.timer[1].count = 10
node[nodenum].trigger.timer[1].passthrough = false
node[nodenum].trigger.timer[1].clear()

-- echo the timer event on tsplink two
node[nodenum].tsplink.trigger[2].stimulus = node[nodenum].trigger.timer[1].EVENT_ID

-- digital IO *could* use timer event directly on this same node
-- but it can also make use of the locally available tsplink two
node[nodenum].digio.trigger[1].clear()
node[nodenum].digio.trigger[1].mode = digio.TRIG_FALLING
node[nodenum].digio.trigger[1].pulsewidth = 100e-6
--node[nodenum].digio.trigger[1].stimulus = node[nodenum].trigger.timer[1].EVENT_ID
node[nodenum].digio.trigger[1].stimulus = node[nodenum].tsplink.trigger[2].EVENT_ID

-- this remote node cannot "see" the timer events on other node
-- this remote node must use the echoed event on tsplink two
nodenum = 2
node[nodenum].digio.trigger[1].clear()
node[nodenum].digio.trigger[1].mode = digio.TRIG_FALLING
node[nodenum].digio.trigger[1].pulsewidth = 100e-6
node[nodenum].digio.trigger[1].stimulus = node[nodenum].tsplink.trigger[2].EVENT_ID


-- issue an assert to get the party started
node[1].tsplink.trigger[1].assert()

3 comments on commit 18a0f4d

@KennethPalesh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Morning Brad,

Do you have any experience w/ communicating to a PLC (AB 5069-L310er) over TCIP? currently I can send data to my keithley (DAQ6510) but I don't know how to write the TSP script to write to my PLC? I found some commands like TSPnet_write in the manual but Im not 100% sure how to do what I need to do?

@Brad-O
Copy link
Collaborator Author

@Brad-O Brad-O commented on 18a0f4d Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally am not very familiar with PLCs. If you wanted more help, I would start a thread on the TekTalk forum (https://my.tek.com/tektalk/) or open a support ticket with our applications team (https://www.tek.com/en/support/contact-technical-support).

This example might be all you need though, it defines some helper functions for TSP-Net on the DAQ6510 and gives a basic usage of commanding a power supply: Instrument_Examples/General/TSP-NET_Seed_Ideas/TSPNet_Intro_04_DAQandPS.tsp

See also page 9-13 of the DAQ6510 Reference Manual which gives an intro TSP-Net.

@KennethPalesh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.