Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PulseGeneration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Software Control System
Tango devices
CounterTimer
NI
PulseGeneration
Commits
bec5ffc9
Commit
bec5ffc9
authored
Nov 17, 2014
by
Sonia Minolli
Browse files
Options
Downloads
Patches
Plain Diff
Add try/catch for stop possible error (TANGODEVIC-787)
parent
ebee51ce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PulseGeneration.cpp
+35
-18
35 additions, 18 deletions
src/PulseGeneration.cpp
with
35 additions
and
18 deletions
src/PulseGeneration.cpp
+
35
−
18
View file @
bec5ffc9
...
...
@@ -2227,6 +2227,7 @@ void PulseGeneration::stop()
this
->
set_internal_state
()
);
}
_NI660XSL_TRY_ACTION
(
pulses
->
stop
(),
...
...
@@ -2236,9 +2237,18 @@ void PulseGeneration::stop()
);
// reconfigure everything here because when using a start trigger
// the start trigger in taken into account only when executing the first Start.
// the start trigger is taken into account only when executing the first Start.
try
{
this
->
init_counters
();
}
catch
(...)
{
// DAQmx 9.x abort pb workaround
ERROR_STREAM
<<
"PulseGeneration::stop() - Releasing pulse object generates error, nothing to do..."
<<
std
::
endl
;
this
->
set_internal_state
();
}
}
//+------------------------------------------------------------------
/**
...
...
@@ -2254,13 +2264,16 @@ void PulseGeneration::abort()
{
DEBUG_STREAM
<<
"PulseGeneration::abort(): entering... !"
<<
endl
;
_NI660XSL_TRY_ACTION
(
pulses
->
abort
(),
"abort"
,
"PulseGeneration::abort"
,
this
->
set_internal_state
()
);
try
{
pulses
->
abort
();
}
catch
(...)
{
// DAQmx 9.x abort pb workaround
ERROR_STREAM
<<
"PulseGeneration::abort() - Aborting pulse object generates error, nothing to do..."
<<
std
::
endl
;
this
->
set_internal_state
();
}
}
...
...
@@ -2427,7 +2440,8 @@ void PulseGeneration::init_counters(void)
start_trigger
->
release
();
}
previous_generation_type
=
generation_type
;
}
catch
(...)
}
catch
(...)
{
//ignore
INFO_STREAM
<<
"FAILED to release start trigger"
<<
endl
;
...
...
@@ -2550,14 +2564,17 @@ void PulseGeneration::init_counters(void)
{
if
(
delay
[
i
]
<
MIN_VALUE_MSECS
)
delay
[
i
]
=
MIN_VALUE_MSECS
;
if
(
pulse_width
[
i
]
<
MIN_VALUE_MSECS
)
pulse_width
[
i
]
=
MIN_VALUE_MSECS
;
string
ctr
=
XString
<
int
>::
convertToString
(
i
);
chan
.
chan_name
=
"/"
+
boardName
+
"/ctr"
+
ctr
;
chan
.
initial_delay
=
initial_delay
[
i
]
/
1000.0
;
//secs
chan
.
low_time
=
delay
[
i
]
/
1000.0
;
//secs
chan
.
high_time
=
pulse_width
[
i
]
/
1000.0
;
//secs
pulses
->
add_time_channel
(
chan
);
INFO_STREAM
<<
"configuring "
<<
chan
.
chan_name
<<
" with: "
;
INFO_STREAM
<<
"delay"
<<
ctr
<<
": "
<<
delay
[
i
]
<<
", "
;
INFO_STREAM
<<
"pulse_width"
<<
ctr
<<
": "
<<
pulse_width
[
i
]
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment